我想实现的功能是当我选中GridView中的某个Item时,这个Item是处于Highlighted的style,其他Item是Normal的style。当我选中另一个Item时,GridView里的Item的style也随着改变。这样的功能要怎么实现呢?Thanks.
我看到ItemContainerStyleSelector是Item初始化的时候可以,但是好像不能动态改变Style。
Hi,
在一些特殊状态下比如指针经过,点击,选中等等。是使用VisualState来管理的。具体修改方法可以看这个FAQ:
http://social.msdn.microsoft.com/Forums/zh-CN/metroappzhcn/thread/67b1f1c1-ff3f-490d-9b53-f2118ae82090
GridView与FAQ中的Button稍有不同:
第一、你需要导出的是GridViewItem的模板而不是GridView的
第二、如果你想要修改选中的效果请修改VisualState中SelectedUnfocused状态,我刚刚回了一个帖子你可以参考一下:
http://social.msdn.microsoft.com/Forums/zh-CN/metroappzhcn/thread/661548ff-3c11-46ad-af27-779741495434
Hope this helps
Aaron Xue [MSFT] MSDN Community Support | Feedback to us Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help.