LongListSelector数据虚拟化 [英] LongListSelector Data Virtualization
问题描述
确实 LongListSelector
支持数据虚拟化?我读了它的几个博客,但不能让它开始工作。
下面是我的尝试:我提供了一个的IList
实施为的ItemsSource
到列表中。问题是,名单调用的GetEnumerator()
而不是将此[INT指数]
来获取一个列表项。
所以我的问题:我如何实现数据虚拟化 LongListSelector
至于数据的加载,可以使用的ObservableCollection完成渐进。我有一个示例项目演示了如何联合使用的ObservableCollection与LongListSelector
基本上,这可以允许以逐渐增加更多的基团和/或更多的数据的组,并且UI应该相应地更新。
Does LongListSelector
support Data Virtualization? I read on several Blogs that it does, but can't get it to work.
Here is what I tried: I provided a IList
implementation as ItemsSource
to the List. The problem is that the List calls GetEnumerator()
instead of this[int index]
to get a list item.
So my question: How do I implement data virtualization for LongListSelector
?
As you said, the LongListSelector is still based around GetEnumerator even for when rendering IList types. Most likely the control would need to be rewritten to support the purpose. While blogs might say it support it, none of them says how, so I'm not inclined to believe them. The LongListSelector's default is to render all items.
As for the loading of the data, it can be done progressive using a ObservableCollection. I got a example project that shows how to use a ObservableCollection in combination with the LongListSelector.
Basically this could allow you to progressively add more groups and/or, more data to the groups, and the UI should update accordingly.
这篇关于LongListSelector数据虚拟化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!