I created a simple application with nested ListBox and strings in it. If i scroll it really fast - there is empty spaces.Can i increase the rendering speed or Can i slow down scrolling speed in ListBox somehow ?
2 Answers
Inorder to overcome the black occurrence on scrolling you need to virtualize your scroll control. For that you should inherit IList and create a Collection of your own similar to ObservableCollection in which you will have to override the default indexer depending on your caching requirement and simultaneously maintain a cache for your items. I feel this might be what you are looking for: http://blogs.msdn.com/b/ptorr/archive/2010/08/16/virtualizing-data-in-windows-phone-7-silverlight-applications.aspx
There is a sample project on that page. Try that out.
I also feel that you are facing this problem http://blog.rsuter.com/?p=258. I guess this will be solved using virtualization itself. Hope it helps
The blog Milan posted is a good source to start with. Virtualizing data works by changing the item template of the list item while scrolling. This will not work up to the expectations when there is a complex layout.
But I suggest you work more on the layout you are working on. Having too many stack panels in order to make the layout a bit generic will destroy the performance.