我该怎么做呢?我发现的所有内容都表明这应该可行,但对我而言不行。我究竟做错了什么?
<ListView ItemsSource="{Binding ListViewItems}" >
<ListView.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Green"/>
</Style.Resources>
</Style>
</ListView.ItemContainerStyle>
</ListView>
最佳答案
您上面显示的代码对我有用。但是,这将设置ListBox处于焦点时的颜色。要在不清晰时设置颜色,请尝试...
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Green" />
Check this在Win 8上实现它的示例。
关于c# - 在 ListView 中更改选择突出显示颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16949170/