Focused button mouse-over state issue
Posted: 16 Jan 2019, 11:16
Can I disable a mouse-over state on a focused button?
MK
MK
Welcome to our official discussion site. You’ll find topics on features, bugs, development, and general support here
https://www.noesisengine.com/forums/
<ControlTemplate x:Key="MyButtonTemplate" TargetType="{x:Type Button}">
<Border x:Name="Bg"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
CornerRadius="1">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource OverBdBrush}"/>
<Setter Property="Background" Value="{StaticResource OverBgBrush}"/>
<Setter Property="Foreground" Value="{StaticResource OverFgBrush}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource PressBdBrush}"/>
<Setter Property="Background" Value="{StaticResource PressBgBrush}"/>
<Setter Property="Foreground" Value="{StaticResource OverFgBrush}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource FocusBdBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="BorderBrush" Value="{StaticResource DisabledBdBrush}"/>
<Setter Property="Background" Value="{StaticResource DisabledBgBrush}"/>
<Setter Property="Foreground" Value="{StaticResource DisabledFgBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate><Button Template="{StaticResource MyButtonTemplate}" ... /><MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsKeyboardFocused" Value="False"/>
<MultiTrigger.Conditions>
<!-- setters for MouseOver state -->
</MultiTrigger>