列表框项目动态负载负载、项目、动态、列表

由网友(骑着草泥马环游世界)分享简介:我要创建动态负载在Silverlight列表框的项目。I want to create dynamic load for items in Silverlight Listbox.当用户达到由滚动条(或鼠标滚轮)项目的结束,那么我想呼吁下一个10(或不同)项新的请求。When user reaches end o...

我要创建动态负载在Silverlight列表框的项目。

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

当用户达到由滚动条(或鼠标滚轮)项目的结束,那么我想呼吁下一个10(或不同)项新的请求。

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?

推荐答案

有很多在Silverlight 3的用户界面虚拟化的进步,但我不认为有什么简单的方法来实现这种类型的数据虚拟化的基础上滚动的列表框。

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.

一个可能的解决方案是将继承ListBox和处理LayoutUpdated事件来获得访问内部的ScrollViewer。然后,您可以访问垂直滚动条针对的ScrollViewer和寄存器来处理ValueChanged事件。如果滚动条值发生变化,这是在其最大的价值(滚动一路下跌),然后你可以要求你的下一组项目,并把它们添加到底层集合的列表框。

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.

阅读全文

相关推荐

最新文章