ScrollViewer.IsDeferredScrollingEnabled="True"

Apr 22, 2010 at 7:50 AM
When changing ScrollViewer.IsDeferredScrollingEnabled="True" to "False" the Loading Animation shows up every time you move the scroll bar. One solution to the problem would be if you show a small-size Loading Animation on each item's row.
Coordinator
Apr 22, 2010 at 10:15 AM

First of all, setting ScrollViewer.IsDeferredScrollingEnabled="False" is not recommended, otherwise any mouse movement can trigger a data loading which is likely to be a lengthy operation and should be reduced as much as possible in the first place.

Secondly, the loading animation (VirtualListLoadingIndicator class) is loosely coupled with other classes and can be customized and/or completely removed. If you prefer to show a small-size loading animation on each row instead, you can change its control template to show as transparent when data is loading, and define your data template for the ListView item to show the small size loading animation based on the IsLoaded value. Keep in mind everything in WPF is lookless.

Coordinator
Apr 22, 2010 at 10:30 AM
Edited Apr 22, 2010 at 10:35 AM

Also reply to your comment of download review regarding AutoResetEvent because I can't reply there:

Firstly AutoResetEventSlim only exists on .Net 4.0, and this solution works for both 3.5 and 4.0;

Secondly the performance hit is not significant because AutoResetEvent.WaitOne is called only when calling QueuedBackgroundWorker<T>.Clear() AND there is unfinished work item - instead of aborting the working thread, I choose to wait it to finish gracefully.

Apr 22, 2010 at 11:17 AM
Edited Apr 22, 2010 at 11:18 AM

I must admit, after spending more time with the code, it deserves a 5-star. You rarely see nowdays FxCop's SuppressMessageAttribute and this makes a lot of people happy! Good coding techniques combined with good ideas  are missing from most small open-source projects.

Moving to .NET 4.0 is not a bad idea anyways. You can use Tasks instead of ThreadPool, the Parallel class, Cooperative Cancellation and also the Concurrent Collection classes.

Since Data Virtualization is a very interesting topic and missing from WPF, it would be interesting to try .NET 4.0 on top of what you have already provided.