ListView控件在Metro应用中添加更多的项目? [英] ListView add more items in Metro apps?

查看:122
本文介绍了ListView控件在Metro应用中添加更多的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我有一个ListView和服务数据中包含超过100项的Metro应用。最初,当我在我的网页加载列表视图它显示只有8个项目加1更多相关的项目,以后如果我在需要添加其他9个项目到我的网页更加项点击并完全有显示在17个项目我页面,需要显示更多的项目也是这样的流动continues.What我应该让我的scenario.Can任何人的帮助me.Below我想给我的ü情景。
谢谢你。

I have a metro application in which I have a Listview and service data contains above 100 items. Initially when am loading listview in my page it has to display only 8 items plus 1 more-related item and later if i click on a more-item it needs add another 9 items to my page and totally it has to show 17 items in my page and need to display more item also like that flow continues.What should I get to get my scenario.Can anyone help me.Below I tried to give u my scenario. Thank you.

推荐答案

有一对夫妇的解决方案 - 一切取决于您要进行的工作。另外,我建议你没有一个更多按钮,如果你能帮助它 - 这是不是最好的用户交互。选项​​2要给你最好的体验。

There are a couple of solutions -- all depending on the work that you want to undertake. Also, I would suggest that you don't have a "More" button if you can help it -- it's not the best user interaction. Option 2 is going to give you the best experience.

选项1

使用 WinJS.Binding.List 作为数据源 - 使用此,你可以操纵它像一个JavaScript 阵列(例如 POP等)。当您添加和放大器;从列表中删除项目,列表视图将反应这些变化。

Use WinJS.Binding.List as your data source -- using this you can manipulate it like a JavaScript Array (e.g. push, pop etc). As you add & remove items from the list, the list view will react to those changes.

全部详情这里

选项2

创建VirtualDataSource推导是密切注意在其中您可以要求你的数据,并能提供一个一致的界面到ListView的方式。这使得使用者介面是完全的灵活性,以它的布局,并且要求足够的数据来满足的可用空间,而虚拟化的UI元素(优于存储器/性能),和数据(确保只有数据的需要的由用户请求

Create a VirtualDataSource derivation that is intimately aware of the ways in which you can request your data, and can offer up a consistent interface to the ListView. This enables your UI to be completely flexible to it's layout, and request enough data to satisfy the available space, while virtualizing the UI elements (better memory/performance), and the data (ensuring only the data needed by the user is requested.

全部样例这里

这篇关于ListView控件在Metro应用中添加更多的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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