Access to tree nodes (TreeViewItem) through bound items.Tree layout can be cached, saved and reapplied.Simple styling on every level: Tree, TreeViewItem, or bound items (via DataTemplates).Optional root node which is not dependent on the tree’s bound items.Convenient context menu handling for tree nodes.This allows either virtualized trees in case getting data is expensive, or low memory trees that keep the number of tree nodes at a minimum. Also provides the option to automatically clear invisible tree nodes. Lazy loading support – does not create tree nodes until the parent node is expanded.SelectedItem is of type Product - no casts required bind flat list of business objects to tree Here’s the tree’s main features at a glance: However, instead of posting a rant that probably nobody would ever read (let alone care about), I worked on an alternative. Furthermore, WPF’s TreeView tends to fire all sorts of SelectedItemChanged events if it’s being refreshed or rebound, which caused side-effects with TwoWay data binding. I became aware of the default control’s limitations during my last project – I naturally started with hierarchical data templates, but was soon confronted with quite a few issues: I missed a simple API to control the tree, and styling of the tree’s nodes proved hard as well. This is a little something I’ve been working on for a while: A replacement (or better: enhancement) of WPF’s built-in TreeView control. ![]() I’ll update the CodeProject article once the current filtering mechanism has been rewritten:ĭownload: wpf-treeview.zip (Current version: 1.0.7, updated 2008.04.06) Update: The latest version is currently only available through the download link below. And please leave your rating if you like the control □ ![]() A tutorial is now available on Code Project, so check the article for a detailed overview.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |