我该如何做?我发现的一切都表明这应该起作用,但它不适合我。我究竟做错了什么?在列表视图中更改选择高亮颜色
<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>
我不知道我的Visual Studio是否有一些错误,但是我发布的代码根本没有做任何事情。我添加了你的代码,但也没有做任何事情。我非常沮丧,因为我在网上找到的所有代码对我的ListView完全没有任何影响,就好像根本没有代码。 – Chris
这可能是由于Windows主题。什么是您的Windows操作系统版本和主题?我注意到了Win 8上的一些颜色相关的问题。 – Nishant
[Check this](http://stackoverflow.com/questions/12007918/list-combo-box-background-and-selected-colours-under-net-4-5 )...如果您在Win 8上运行您的应用程序,您似乎需要为ListBoxItem编写自己的模板。 – Nishant