【发布时间】:2011-05-31 10:24:11
【问题描述】:
我试图在选择 ListBox 中的项目时禁用突出显示。这意味着,ListBox 中的项目仍会触发 select 事件,但不会改变颜色
【问题讨论】:
标签: windows-phone-7 listbox selection highlight
我试图在选择 ListBox 中的项目时禁用突出显示。这意味着,ListBox 中的项目仍会触发 select 事件,但不会改变颜色
【问题讨论】:
标签: windows-phone-7 listbox selection highlight
kP 在此处概述了应用突出显示的过程。
Windows Phone 7: Highlight Selected Listbox item
删除突出显示的过程几乎相同。您只需从您制作的模板副本中删除处于选定视觉状态的情节提要。
所以..
<VisualState x:Name="Selected">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
到
<VisualState x:Name="Selected"/>
【讨论】: