积极答复者
如何用ListView实现静态文本列表

问题
-
想要显示一个列表,是纯文本的,当使用ListView时,当鼠标放到某一条文本记录上时,该记录状态是会改变的。会和其他记录有明显区别。
如果把ListView的IsHitTestVisible设置成flase,则无法通过滑动查看当前屏幕显示不下的内容。
现在用笨方法把ListViewItem的默认Style拷贝了一份到当前XAML中,然后把VisualState x:Name="PointerOver"删除,可以实现。
不知道有没有更好的办法?另外如果我想更改一个Style里的某一个VisualState,只能把整个<Setter Property="Template">重写吗?有没有办法只改相应的VisualState?
答案
-
Hi,
你是按照这个做的吗?
http://social.msdn.microsoft.com/Forums/zh-CN/winstoreappzhcn/thread/6a6f913a-001a-40c6-9fae-5e78ea0d29c4
你用Blend将模板输出就可以找到UnselectedPointOver,修改应该很简单的。
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 xukai_duokan 2013年3月20日 6:31
全部回复
-
Hi,
我不推荐你使用IsHitTestVisible解决问题。最好是不要去设置这个属性。
我自己设置ListViewItem没有遇到问题,你修改的是什么VisualState?我修改的是UnselectedPointOver。
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Hi,
你是按照这个做的吗?
http://social.msdn.microsoft.com/Forums/zh-CN/winstoreappzhcn/thread/6a6f913a-001a-40c6-9fae-5e78ea0d29c4
你用Blend将模板输出就可以找到UnselectedPointOver,修改应该很简单的。
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 xukai_duokan 2013年3月20日 6:31
-
Hi,
那个里面有一个修改ListViewItem的方法,你在Blend中save一下,切到VS代码会自动调出来,之后按照你需要的修改就好。
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.