I have some question regarding HierarchicalCollectionView while trying to troubleshoot some performance/memory issue within TreeListView.
1. why a SingleItemHierarchicalCollectionView is created for each root item, even through there is no childrens . (we retrieve the children dynamically when user clicks the expand icon).
2. The method in HierarchicalCollectionView seems problematic to us:
internal override void ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
if (args.Action == NotifyCollectionChangedAction.Reset && EnumerableExtensions.Count(this.SourceCollection) == 0)
it seems it will only clear the ChildrenViewByItem when reset event happen with SourceCollection contains nothing. While in our case the sourceCollection normally contains something total new and it ends up leaking HierarchicalCollectionView/SingleItemHierarchicalCollectionView.
3. RemoveChildrenView/RemoveViewAndDisposeRecursive seems slow when the old source collection is very large .(and there is reset event with empty new SourceCollection). I can provide more detail if you want.