开发者

WP7 LongListSelector - find control inside DataTemplate

开发者 https://www.devze.com 2023-03-04 06:04 出处:网络
I have a collection bound to a longlistselector. When a button in the applicationbar is clicked, I want to show a column that was previously hidden inside the longlistselecto开发者_开发百科r. How can

I have a collection bound to a longlistselector. When a button in the applicationbar is clicked, I want to show a column that was previously hidden inside the longlistselecto开发者_开发百科r. How can I get access to the grid inside my datatemplate so I can toggle the column's visibility?

I tried the FindName method but it keeps returning null for the control I want. Am I missing something?


Rather than finding the inside the template, how about binding the Visibility property of the 's contents to a property in your view model. Then all you need to do is change the view models property and the 's contents will show or hide.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号