A tutorial is now available on Code Project, so check the article for a detailed overview.And please leave your rating if you like the control 🙂 The latest version is currently only available through the download link below.
Furthermore, WPF’s Tree View tends to fire all sorts of events if it’s being refreshed or rebound, which caused side-effects with Two Way data binding.
However, instead of posting a rant that probably nobody would ever read (let alone care about), I worked on an alternative.
Here’s the tree’s main features at a glance: class that provides this functionality, is abstract.
This means you have to write a little code yourself.
Ok, if I measure the call to Refresh() it doesn’t take more than 100 ms or so, but like the call sets in motion alot of other things that will happen after my method has exited, which is understandable since the documentation states that the whole view is recreated and therefore I assume the whole tree of items of the visualtree concerned is re-created too. Since I’m a quidnunc I won’t be satisfied with this! First, let’s examine exactly what is happening in your scenario.
If I instead just remove the item, and just re-insert it, it’s as close as I can get to instantaneous. So I’m asking the great Dr, that has given us all such great in depth knowledge in the past, what can we do about this in a more generic fashion? What would you suggest I do if I have a collection of a type that I don’t know about at compile time? Dear Patient-X, I’ve been wondering what I could file under the letter ‘E’ in this series, and now you’ve afforded me the perfect opportunity! Understanding the List Collection View Class You are binding to a list of items.
No, you are not lost in your path to enlightenment. More specifically, you are binding to a collection of Person objects (namely an Observable Collection) that, in turn, implements the IList interface.
However, you’ll probably manage with 3 lines of code, as the base control just needs to know 3 things: I’m planning to write a Code Project article for this one, but for now, it’s only available through my place without a tutorial.
However: The library comes with a sample project that shows pretty much all features of the control.
Project format is currently VS2008 only, but binaries which target .
Whilst having an Observable Collection of “Person” objects, and creating a collectionview for this and also adding a Sort Description on a “Name” property on the “Person” object, I noticed that if I change the “Name” property on one of the objects (they are shown in a listbox, having the “Name” property databound to a textblock), and thereafter calling Refresh() on the Collection View, the refresh will actually take more than a second with only about 50 items.