Hover styling now takes precedence over IsChecked styling for Buttons

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 1 year ago by Alex George - CNC Software
Version: 24.1.3
Avatar

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>

Comments (2)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Alex,

We will update the template for the next maintenance release to use the checked border instead of hover border when in a checked/hover state.  That will provide a little differentiation between the two states since the checked border is darker than the hover border.


Actipro Software Support

Posted 1 year ago by Alex George - CNC Software
Avatar

Great, thank you

The latest build of this product (v25.1.2) was released 10 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.