【发布时间】:2012-02-16 23:05:07
【问题描述】:
<Style TargetType="ListBoxItem">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
</Style.Resources>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
上面的代码旨在防止任何突出显示颜色被用作我的列表框项目的“选择指示符”。我的程序有一个完全白色的背景,我打算使用一些自定义动画来表示选择。上面的代码确实删除了传统的蓝色突出显示,但它也使文本(在项目容器内)完全消失,所以我看到的只是一个白色项目。
有什么想法吗?
【问题讨论】: