![]() ![]() NET 1.0 era, I don’t think any other control had the word “View” tacked onto the end of its name, except for ListView. ![]() Why not call it the Tree control? Why did they add the word “View” to the end? At the time, the. When I first started learning about Windows Forms, I thought the TreeView control had a strange name. My recent article about it, which, by the way, is my wedding gift to Sacha Barber, discusses how the ideal way of working with a TreeView is to bind it to a ViewModel, and then program against the ViewModel. ![]() have been thinking a lot about the WPF TreeView control lately. (tier3Object = new Tier3Object(currentElementTypeName)) If( = 0 || (tier3Object1 => tier3Object1.Tier3ElementTypeName != currentElementTypeName)) (tier2Object = new Tier2Object(currentFamilyName)) If( = 0 || (tier2Object1 => tier2Object1.Tier2FamilyName != currentFamilyName)) Var currentFamilyName = revitElementInstance.FamilyName Tier1CategoryNames.Add(tier1Object = new Tier1Object(currentCategoryName)) If(Tier1CategoryNames.Count = 0 || Tier1CategoryNames.All(tier1Object1 => tier1Object1.Tier1CategoryName != currentCategoryName)) Tier1CategoryNames = new ObservableCollection() įoreach(var revitElementInstance in _revitElementInstances) Private static void InitializeDataSource() Way shorter and simpler than i thought it would be. The method below is truly the meat of the solution and along with the XAML in the previously attached ZIP file make it work. Initially, my inexperience drove me to go the "safe" route towards populating the TreeView but on thursday i deleted most of what id done and fully embraced MVVM and working with Objects, in an object, in an object, in an object! Was a mind melter for me but it really paid off! I will gladly share this solution with any needing it so if you're interested please contact me. Much has happened since last Wednesday and i can report back that i now have a virtualized TreeView which will quickly handles projects with 200,000+ model elements! Jeremy, thank you for your suggestions and for continuing to help me and the community! Ive attached a zip file with the code in question.Ive enabled UI Virtualization to show more as a user expands each node.The TreeView is initially fully collapsed with only the first tier showing.There are 4 tiers (See screenshot 1) of data arranged in the following manner.Ive submitted a support ticket to Telerik which only confirmed that the code should be working and does outside of Revit where I can create 180000 objects into 4 tiers in seconds.Ive timed the Filtered Element Collectors and found they are incredible fast and dont seem to be the issue.I'm using WPF / XAML / MVVM / C# to build it.Here is some additional pertinent information. Project with less than 400 model Element Instances it takes about 5 seconds to build.Project with around 66,000 model Element Instances it takes about a minute to build.Project with around 150,000 model Element Instances it takes about 2 minutes to build.Some examples of window load times below. I'm not sure what to suspect now and am hoping one of the community has ran across this. The problem is that even with UI Virtualization the window load times are far too long. A tool i'm building has a TreeView Control (Telerik RadTreeView) which will show all element instances in a Project/Active/Selection.
0 Comments
Leave a Reply. |