Reputation: 2879
I currently have this, but it only work for the foreground colour.
Any help would be apriciated :D
<Style.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Foreground" Value="Red" />
<Setter Property="Background" Value="Green"/>
</Trigger>
</Style.Triggers>
Upvotes: 14
Views: 34513
Reputation: 29614
This will take care of the background color, maybe it will also help you find the solution for the foreground, this is from http://blogs.msdn.com/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx
<Style TargetType="ListBoxItem">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Green"/>
</Style.Resources>
</Style>
Upvotes: 28
Reputation: 14111
It is the Border sub-element of the ListViewItem named "Bd" which handles background painting.
<Setter TargetName="Bd" Value="Green" Property="Background" />
Upvotes: 1