I have a class that Inherits from ItemsControl and also a VirtualizedPanel that inherits from VirtualizedStack Panel, I created the templates so that the my Controls holds the Itemspresenter inside a ScrollViewer and have all Vitualizing Properties enabled as well as the CanContentScroll.
The problem is that I’m using DataVirtualization in the back end so I don’t have all the collection on memory and in WPF when the ItemsControl gets loaded it calls the GetEnumerator() so it tries to go all over the collection. In Silverlight this is not happening, the ItemsControl just call the visible items using the Indexer of my Collection which implements IList.
Is there a way to make the ItemsControl in WPF to just use the indexer instead of trying to load all the collection through the IEnumerable?
Virtualization is only applied to ListBox and ListView by default in WPF….try out using one of these controls…