<Style TargetType="{x:Type ListBox}"> <Setter Property="ItemContainerStyle"> <Setter.Value> <Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource ListBoxItemStyle}"> <Style.Resources> <!-- Background of selected item when not focused --> <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="{DynamicResource ResourceKey={x:Static SystemColors.HighlightColorKey}}"/> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{DynamicResource ResourceKey={x:Static SystemColors.HighlightColorKey}}"/> </Style.Resources> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Panel.Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> </Trigger> </Style.Triggers> </Style> </Setter.Value> </Setter> </Style>
'.NET > WPF' 카테고리의 다른 글
WPF Graphics Rendering (0) | 2021.08.15 |
---|---|
Routed Event (0) | 2021.08.15 |
ScrollViewer Tips (0) | 2021.08.15 |
Save Canvas as an Image (0) | 2021.08.15 |
LayoutTransform vs. RenderTransform (0) | 2021.08.15 |