wpf
wpf copied to clipboard
Button hilite color
Window 11 fluent theme.
When trying to define custom hi-lite color for button in old way:
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Background" Value="Red"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Lime"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
It's does not work. I also trying to set new styles:
<Button.Resources>
<SolidColorBrush x:Key="ButtonPointerOverBackgroundBrush" Color="Red"/>
<SolidColorBrush x:Key="ButtonPressedBackgroundBrush" Color="DarkRed"/>
</Button.Resources>
But it does not seems work neither.