开发者

Listbox items dynamic load

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

When user r开发者_如何学Ceaches 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?


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜