在Windows Phone 8.1的“列表”项中显示隐藏内容(Show hide content in List item in Windows Phone 8.1)

编程入门 行业动态 更新时间:2024-10-24 22:23:14
在Windows Phone 8.1的“列表”项中显示隐藏内容(Show hide content in List item in Windows Phone 8.1)

我正在开发WP8.1应用程序,因为我需要显示一些带有显示/隐藏功能的内容。 将显示前2行,一旦点击该项目,剩余内容应展开并显示。 我们如何在WP8.1中实现这一目标

I'm developing WP8.1 app in that I need to show some content with show/hide functionality. First 2 lines will be displayed and once clicking on that item the remaining content should expanded and display. How we can achieve this in WP8.1

最满意答案

为了显示或隐藏你必须去绑定。

要扩展内容,请将DataTemplate作为StackPanel,并将TextBlock的Height属性(通过绑定)设置为显示两行所需的值。

在点击该项目时,只需获取selectedItem实例并增加height属性或设置为auto

要了解绑定,请参阅此处http://msdn.microsoft.com/en-us/library/windows/apps/cc278072(v=vs.105).aspx

In order to show or hide you have to go for binding.

And to expand the content, have your DataTemplate as StackPanel and set the Height property of TextBlock (through binding) with the value that is needed to display two lines.

And on tap of the item, just get the selectedItem instance and Increase the height property or set to auto

To know about binding see here http://msdn.microsoft.com/en-us/library/windows/apps/cc278072(v=vs.105).aspx

更多推荐

本文发布于:2023-07-24 20:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1250581.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:内容   列表   Phone   Windows   item

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!