按顺序加载大列表 [英] Load a large list in sequences

查看:66
本文介绍了按顺序加载大列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有很多对象想要加载到LongListSelector(Windows Phone 7.1)中.

I have a large collection of objects which I would like to load in a LongListSelector(windows phone 7.1).

现在,问题是,如果我使用任务和异步方法将它们加载到选择器中,则需要一段时间才能加载所有内容,同时冻结了UI并且什么也没有发生,所有元素都同时弹出时间.

Now, the problem is, if I use a task and an async method to load these into the Selector, it takes a while till everything is loaded, meanwhile the UI is frozen and nothing happens, all elements pop up at the same time.

我想让列表按组加载元素,显示元素,然后进入下一个组.我该怎么办?

I want to have the list load elements in groups, display the elements, then get to the next group. How do I do that?

推荐答案

没有示例代码很难提供特定的解决方案,但是如果您能够将数据加载到不会使UI线程停顿的线程中,并使其与LongListSelector控件保持不相关联,直到完成.然后将其分配给 ItemsSource(例如).

It is hard to provide a specific solution without example code, but if you might be able to load the data in a thread that does not stall the UI thread, and keep it unassociated with the LongListSelector control until it is complete. Then assign it to the ItemsSource (for example).

如果您要重新设计LongListSelector,请 Silverlight Toolkit 让您重新编译在那里找到的类似控件(WP7 LongListSelector和LongListMultiSelector).

Also if you want to re-engineer LongListSelector, the Silverlight Toolkit lets you recompile similar controls found there (WP7 LongListSelector and LongListMultiSelector).

希望这会有所帮助,
标记

Hope this helps,
Mark


这篇关于按顺序加载大列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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