I ListBoxItem
trying to set my selection color for ListBoxItem
. I try this:
<ListBox x:Name="AccountListBox" ItemsSource="{Binding}"> <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="Background" Value="LightSteelBlue"/> <Setter Property="Margin" Value="5"/> <Setter Property="Padding" Value="5"/> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Foreground" Value="White"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="BorderBrush" Value="Black"/> </Trigger> </Style.Triggers> </Style> </ListBox.ItemContainerStyle> </ListBox>
As a result, not selected Aytem looks as it should, but the selected one remains standard. What am I doing wrong? Google and everywhere asked so. And BorderThickness
is set correctly, but there is no color.