如何根据longlistselector的当前滚动位置显示数据 [英] How to display data according the current scroll position of a longlistselector

查看:84
本文介绍了如何根据longlistselector的当前滚动位置显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要实现的效果是内置日历应用中的天"标签.

The effect that I want to achieve is the day tab in the built-in calendar app.

滚动时间表列表时,文本框会动态显示当前显示的时间表的日期.

When you scroll the list of timetable, a textbox dynamically displays the date of the timetable currently being displayed.

我想知道是否有任何简单的方法来实现这一点.

I wonder if there is any easy way to implement this.

预先感谢!

推荐答案

一种方法是在LongListSelector的DataTemplate中.

One way to do this is in the DataTemplate for the LongListSelector.

对其进行设计,以使两个可视UI元素彼此重叠,然后更改 通过数据绑定显示以仅显示所需的元素.将两个新属性添加到绑定的数据项中,以指定两个选项的可见性.

Design it so there are two visual UI elements overlapping each other, and you change the Visibility via databinding to show only the desired uielement. Add two new properties to the bound data item that specify the visibility of the two options.

您可以尝试使用 Twitter 示例.

You can experiment with the Twitter sample.

希望这会有所帮助,
标记

Hope this helps,
Mark


这篇关于如何根据longlistselector的当前滚动位置显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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