2025-07-11 09:20:23 +08:00
|
|
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
2025-02-10 20:53:40 +08:00
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
|
|
|
<ResourceDictionary Source="/WPFluent;component/Resources/Variables.xaml" />
|
|
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
<Thickness x:Key="ToggleButtonPadding">11,5,11,6</Thickness>
|
2025-02-10 20:53:40 +08:00
|
|
|
<Thickness x:Key="ToggleButtonBorderThemeThickness">1</Thickness>
|
|
|
|
|
<Thickness x:Key="ToggleButtonIconMargin">0,0,8,0</Thickness>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="DefaultToggleButtonStyle" TargetType="{x:Type ToggleButton}">
|
|
|
|
|
<!-- Universal WPF UI focus -->
|
|
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
|
|
|
|
|
<!-- Universal WPF UI focus -->
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
|
|
|
|
|
<Setter Property="Border.CornerRadius" Value="{StaticResource ControlCornerRadius}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
|
|
|
|
|
<Setter Property="BorderThickness" Value="{StaticResource ToggleButtonBorderThemeThickness}" />
|
|
|
|
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
|
|
|
|
<Setter Property="FontWeight" Value="Normal" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="MinHeight" Value="32" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Padding" Value="{StaticResource ToggleButtonPadding}" />
|
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
|
|
|
<Border
|
|
|
|
|
x:Name="ContentBorder"
|
|
|
|
|
Width="{TemplateBinding Width}"
|
|
|
|
|
Height="{TemplateBinding Height}"
|
|
|
|
|
MinWidth="{TemplateBinding MinWidth}"
|
|
|
|
|
MinHeight="{TemplateBinding MinHeight}"
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
|
|
|
|
Background="{TemplateBinding Background}"
|
2025-07-11 09:20:23 +08:00
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
CornerRadius="{TemplateBinding Border.CornerRadius}"
|
|
|
|
|
Padding="{TemplateBinding Padding}">
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
x:Name="ContentPresenter"
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
Content="{TemplateBinding Content}"
|
|
|
|
|
TextElement.FontSize="{TemplateBinding FontSize}"
|
|
|
|
|
TextElement.Foreground="{TemplateBinding Foreground}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsEnabled" Value="False" />
|
|
|
|
|
<Condition Property="IsChecked" Value="False" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlFillColorDisabledBrush}" />
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
|
|
|
|
|
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsEnabled" Value="False" />
|
|
|
|
|
<Condition Property="IsChecked" Value="True" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource AccentFillColorDisabledBrush}" />
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ControlFillColorTransparentBrush}" />
|
|
|
|
|
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextOnAccentFillColorDisabledBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsEnabled" Value="True" />
|
|
|
|
|
<Condition Property="IsChecked" Value="True" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource SystemFillColorAttentionBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource AccentControlElevationBorderBrush}" />
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextOnAccentFillColorPrimaryBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
|
|
|
<Condition Property="IsChecked" Value="False" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
|
|
|
<Condition Property="IsChecked" Value="True" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource SystemFillColorAttentionBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsPressed" Value="True" />
|
|
|
|
|
<Condition Property="IsChecked" Value="False" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlFillColorTertiaryBrush}" />
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
|
|
|
|
|
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsPressed" Value="True" />
|
|
|
|
|
<Condition Property="IsChecked" Value="True" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource SystemAccentColorTertiaryBrush}" />
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ControlFillColorTransparentBrush}" />
|
|
|
|
|
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextOnAccentFillColorSecondaryBrush}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
2025-07-11 09:20:23 +08:00
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style BasedOn="{StaticResource DefaultToggleButtonStyle}" TargetType="{x:Type ToggleButton}" />
|
|
|
|
|
|
2025-07-11 09:20:23 +08:00
|
|
|
</ResourceDictionary>
|