Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

VirtualizingStackPanel change in behavior in .NET 4.6.1

$
0
0

We have an application which could potentially load millions of rows into a ListView.  Or at least, it gives that perception to the user.  In reality, most of the data is not loaded and only gets loaded when scrolled into view.

This was based on an article we found here:

http://blogs.microsoft.co.il/tomershamam/2009/10/01/ui-virtualization-vs-data-virtualization-part-2/

This has worked fine up through and including .NET 4.6.0.  However, we have found if a machine has 4.6.1 installed, the concept all of a sudden breaks.  The UI is suddenly trying to request many more rows than it used to.

At first, we thought this was due to the use of the Enterprise Library Caching Block, which has now been deprecated.  But we switched it over to System.Runtime.Caching and behavior was the same.  Digging deeper, we found what seems to be the true cause.

One of the underlying ways this works is, as the article states, the CollectionView.GetItemAt method "is called by the VirtualizingStackPanel for each item in view, in addition to the selected one".  So, it overrides GetItemAt and knows this means an item is visible and should be loaded from the backing store.

With .NET 4.6.1 - this seems to no longer be true.  Instead, GetItemAt gets called immediately for all items, causing every item to attempt to load from the backing store.  We have tested and repeated this on multiple machines and the behavior is quite consistent.  Have 4.6.0, everything is fine.  Install the 4.6.1 update, it breaks.  Uninstall 4.6.1 and reinstall 4.6.0, and it works fine again.

Searching, I found this article which is using essentially the same concept:

http://www.codeproject.com/Messages/5175713/No-longer-works-with-NET.aspx

And I also note the selected comment there which describes essentially noticing the same behavior.

Any ideas why this has changed and what can be done about it?



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>