Windows Phone 上的分页数据/无限滚动 [英] Paging data / infinite scrolling on Windows Phone

查看:31
本文介绍了Windows Phone 上的分页数据/无限滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在 WindowsPhone Listbox 控件上是否有其他分页数据的解决方案.我习惯分页数据,通过手动检查滚动条位置,当它到达屏幕末尾时,然后加载更多数据.

I want to know is there any other solution of paging data on WindowsPhone Listbox control. I am used to paging data, by manually checking scrollbar position, and when it reaches the end of screen, then more data is loaded.

我想问一下,是否有其他解决方案(更好)来执行此操作(WP7 或 WP8).我提到的我的解决方案与编写大量代码(自定义事件、滚动侦听器等)有关.我认为,可能有更简单的解决方案,因为 WindowsPhone sdk 8.0 已经发布...

I want to ask, is there any other solution (better) of doing this (WP7 or WP8). My solution, which I've mentioned is connected with writing a lot of code (custom events, scroll listener, etc.) I think, there might be an easier solution, as WindowsPhone sdk 8.0 has been released...

推荐答案

您可以使用 Horizo​​ntalCompressionVerticalCompression 的 VisualStatesGroups,以便您能够检测当您位于 ListBox 底部时.

You can use the VisualStatesGroups that are HorizontalCompression and VerticalCompression, so that you're able to detect when you're around the bottom of a ListBox.

这自 Mango 以来一直存在,因此不是 WP8 的新功能,但听起来绝对比您当前的hacky"事件处理程序解决方案更好.

This has been around since Mango so isn't a new WP8 feature, but definitely sounds better than your current solution of "hacky" event handlers.

在 MSDN 博客上阅读相关内容 - Windows Phone Mango 更改,列表框:如何检测压缩(滚动结束)状态?"

如果您不想更改控件,则可以在 中找到 LongListSelectorWindows Phone 工具包(注意这是 WP8 中的原生),它可能当然是解决问题的更好方法,链接文章中提到这是新的方法旧文章对 Mango 的看法.

If you're not avert to changing the control, there is LongListSelector, found in the Windows Phone Toolkit (note this is native in WP8) which may certainly be a better way to approach the problem, it's mentioned in the linked article that this is the new way to do what the old article got at for Mango.

这篇关于Windows Phone 上的分页数据/无限滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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