我正在尝试禁用ListBox中选定项的高亮显示。也就是说,该项仍会触发选择事件,但不会改变颜色。
kP在这里介绍了应用高亮的步骤。
删除高亮的过程与应用高亮的过程基本相同。您只需从模板的所选可视状态中删除Storyboard即可。
所以……
<VisualState x:Name="Selected">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
to
<VisualState x:Name="Selected"/>