Files
ShrlAlgoToolkit/WPFDark/Controls/BiaToggleButton.xaml

68 lines
3.6 KiB
Plaintext
Raw Normal View History

2025-07-11 09:20:23 +08:00
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:WPFDark.Controls"
xmlns:wpf="clr-namespace:WPFDark"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type controls:BiaToggleButton}">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundBrushKey}" />
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrushKey}" />
<Setter Property="Height" Value="{x:Static wpf:Boxes.BasicOneLineHeight}" />
<Setter Property="CornerRadius" Value="{x:Static wpf:Boxes.BasicCornerRadiusPrim}" />
<Setter Property="Behavior" Value="{x:Static controls:BiaToggleButtonBehavior.Normal}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonActiveBackgroundBrushKey}" />
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrushKey}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsPressed" Value="True" />
<Condition Property="IsPressedMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{DynamicResource ButtonPressedBackgroundBrushKey}" />
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrushKey}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsPressed" Value="True" />
<Condition Property="IsPressedMouseOver" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundBrushKey}" />
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrushKey}" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ButtonInactiveBackgroundBrushKey}" />
<Setter Property="Foreground" Value="{DynamicResource InactiveForegroundBrushKey}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundBrushKey.IsChecked}" />
<Setter Property="Foreground" Value="{DynamicResource AccentForegroundBrushKey}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="True" />
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundBrushKey.IsChecked.IsMouseOver}" />
<Setter Property="Foreground" Value="{DynamicResource AccentForegroundBrushKey}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="True" />
<Condition Property="IsEnabled" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundBrushKey.IsChecked.IsDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonInactiveForegroundBrushKey}" />
</MultiTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>