我正在开发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
更多推荐
发布评论