简体   繁体   中英

Consuming large dataset in Silverlight 4

I want to take advantage of the async loading of data since it's possible my users could have latent connections. It is possible they pull back data numbering in the thousands of records and sometimes even more. I don't have a datasource available to me right now that would give me my thousands of records right now. I just want to confirm that a user would be able to see the contents of the grid or listbox while the rest of the dataset loads async in the background. It looks like data virtualization could be an option but the articles I have found have either been trash or based on an older version of SL. Does anyone have any links to and POC or examples of this behavior?

If I enable datapaging on my listbox would the first page of data display on the screen as the rest is being fetched? Or does it only load the data as the user navigates to the next page?

You can take advantage of Data Virtualization,

  • Make the number of UI elements to be created proportional to what is visible on screen using VirtualizingStackPanel.IsVirtualizing="True".

  • Have the framework recycle item containers instead of (re)creating them each time, by setting VirtualizingStackPanel.VirtualizationMode="Recycling".

  • Defer scrolling while the scrollbar is in action by using ScrollViewer.IsDeferredScrollingEnabled="True". Note that this only improves perceived performance, by waiting until the user releases the scrollbar thumb to update the content. However, we will see that it also improves actual performance in the scenarios described below.

The above text is from the excellent Data Virtualization document by Bea Stollinz, written for WPF but should be adopted in Silverlight too.

You may also take advantage of .NET asynchronous programming model such as the IAsyncResult , TPL and the EAP .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM