Hello,
My team recently updated from version 19 to 24. We noticed that the styling of Buttons that are checked and have mouse-over was changed, so that the Hover styling now takes priority over the Checked styling. This means that when you hover over a button and click it, it does not appear that it has been toggled until the mouse leaves again. We consider this a defect, was this an intentional change?
v19 trigger order (IsChecked is followed by IsMouseOver)
<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static themes:AssetResourceKeys.ButtonForegroundCheckedBrushKey}}" />
<Setter TargetName="chrome" Property="State" Value="Checked" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static themes:AssetResourceKeys.ButtonForegroundHoverBrushKey}}" />
<Setter TargetName="chrome" Property="State" Value="Hover" />
</Trigger>
v24 trigger order (IsMouseOver followed by IsPressed/IsChecked)
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static themes:AssetResourceKeys.ButtonForegroundHoverBrushKey}}" />
<Setter TargetName="chrome" Property="State" Value="Hover" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static themes:AssetResourceKeys.ButtonForegroundPressedBrushKey}}" />
<Setter TargetName="chrome" Property="State" Value="Pressed" />
</Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="true">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static themes:AssetResourceKeys.ButtonForegroundPressedBrushKey}}" />
<Setter TargetName="chrome" Property="State" Value="Pressed" />
</Trigger>
![]()