LongListSelector数据虚拟化 [英] LongListSelector Data Virtualization

查看:137
本文介绍了LongListSelector数据虚拟化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确实 LongListSelector 支持数据虚拟化?我读了它的几个博客,但不能让它开始工作。



下面是我的尝试:我提供了一个的IList 实施为的ItemsSource 到列表中。问题是,名单调用的GetEnumerator()而不是将此[INT指数] 来获取一个列表项。



所以我的问题:我如何实现数据虚拟化 LongListSelector

解决方案
<甚至渲染IList的类型当p>正如你所说,LongListSelector仍然存在的GetEnumerator基础。最有可能的控制将需要被重写,以支持的目的。虽然博客可能会说,它支持的话,他们没有说怎么样,所以我并不倾向于相信他们。该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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆