views:

280

answers:

2

I want to create dynamic load for items in Silverlight Listbox.

When user reaches end of items by scroll bar (or mouse wheel), then I want call new request for next 10 (or some different) items.

And problem is which event on listbox can handle this?

A: 

Start here, with Bea Stolnitz' article on data virtualization in Silverlight.

Ken Smith
It's not a answer, because he talking about data virtualization and that data virtualization didn't work in Silverlight.
MicTech
+2  A: 

There were a lot of advances for UI virtualization in Silverlight 3, but I don't think there is any easy method to achieve this type of data virtualization based on scrolling for the ListBox.

One possible solution would be to subclass ListBox and handle the LayoutUpdated event to get access to the internal ScrollViewer. You can then access the vertical ScrollBar for that ScrollViewer and register to handle the ValueChanged event. If the ScrollBar value changed and it is at its maximum value (scrolled all the way down), you could then request your next set of items and add them to the underlying collection for the ListBox.

Check out this blog post on the idea. Not sure if it is the best approach, but it seems to be a solution that might work.

Dan Auclair
Blog post is look nice, I will try that. Thanks
MicTech