为listbox设置itemssource时暂停 [英] Pause when setting itemssource for listbox

查看:112
本文介绍了为listbox设置itemssource时暂停的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



每当Windows Phone 7应用程序将C#代码中的列表框项目源绑定到大型收藏列表时,就会暂停(列表越大,暂停越大,锁定UI。这有什么工作吗?数据虚拟化工作正常,
你可以假设我的Collection列表很大(10,000多个元素)。


Whenever the Windows Phone 7 application binds a listbox itemssource within C# code to a large Collection list there is a pause (the bigger the list, the bigger the pause) which locks the UI. Is there any work around for this? Data virtualization works fine, and you can assume that my Collection list is large (10,000+ elements).




谢谢!

推荐答案

数据虚拟化就是诀窍

http://blog.landdolphin.net/?p=78



如果你有一个巨大的列表你显然需要使用虚拟化堆栈面板。 Stackpanels的启动时间较慢,但滚动性能更好。虚拟化堆栈面板可创建大约3个数据屏幕,但在可以完全回收
容器时效果最佳。 如果您有不同大小的项目和不同的容器,您将失去虚拟化的好处并且滚动更糟。  David Anson有一些不错的

code
虚拟化堆栈面板,为您提供两者中最好的,以便查看是否适合您的应用。

http://blogs.claritycon.com/blogs/kevin_marshall/archive/2010/10/26/wp7-development-tips-part-1。 aspx

Data Virtualization is the trick
http://blog.landdolphin.net/?p=78

If you have a huge list you obviously need to use a virtualizing stack panel. Stackpanels have a slower startup time, but scrolling perf is goign to be better. Virtualizing stack panels create about 3 screens of data, but work best when it can fully recycle containers.  If you have varying sized items and different containers you lose the benefits of virtualization and have worse scrolling.  David Anson has some good code around using a stack panel instead of a virtualizing stack panel that gives you the best of both so see if that might be right for your app.
http://blogs.claritycon.com/blogs/kevin_marshall/archive/2010/10/26/wp7-development-tips-part-1.aspx

 


这篇关于为listbox设置itemssource时暂停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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