2025-12-23 21:35:54 +08:00
|
|
|
<ResourceDictionary
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-01-02 17:30:41 +08:00
|
|
|
xmlns:assist="clr-namespace:Melskin.Assists"
|
|
|
|
|
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
|
2026-01-02 17:30:30 +08:00
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
2025-12-23 21:35:54 +08:00
|
|
|
|
2026-01-02 17:30:30 +08:00
|
|
|
<Style TargetType="{x:Type ToggleButton}" x:Key="EmbossToggleButtonStyle">
|
2025-12-23 21:35:54 +08:00
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
|
|
|
|
|
<!--<Setter Property="BorderBrush" Value="{DynamicResource BackgroundLayoutBrush}" />-->
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="Padding" Value="12,4" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
|
|
|
<Grid>
|
|
|
|
|
<decorations:EmbossBorder
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
Intensity="0.6"
|
|
|
|
|
Margin="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
ShaderEnabled="True"
|
|
|
|
|
x:Name="emboss" />
|
|
|
|
|
<decorations:SlotBorder
|
2025-12-23 21:35:54 +08:00
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
Intensity="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
Margin="0"
|
|
|
|
|
ShaderEnabled="False"
|
|
|
|
|
x:Name="slot">
|
2025-12-23 21:35:54 +08:00
|
|
|
<ContentPresenter
|
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
Margin="{TemplateBinding Padding}"
|
2025-12-23 21:35:54 +08:00
|
|
|
RecognizesAccessKey="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
x:Name="contentPresenter" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</decorations:SlotBorder>
|
|
|
|
|
</Grid>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
|
|
|
|
<Trigger Property="Button.IsDefaulted" Value="True" />
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="ShaderEnabled" TargetName="slot" Value="True" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource PrimaryGradientBrush}" />
|
|
|
|
|
<Setter Property="ShaderEnabled" TargetName="emboss" Value="False" />
|
|
|
|
|
<Setter Property="Intensity" TargetName="slot" Value="0.9" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsChecked" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource PrimaryGradientBrush}" />
|
|
|
|
|
<Setter Property="Visibility" TargetName="emboss" Value="Collapsed" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsChecked" Value="True" />
|
|
|
|
|
<Condition Property="IsPressed" Value="False" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Intensity" TargetName="slot" Value="0.6" />
|
|
|
|
|
<Setter Property="ShaderEnabled" TargetName="slot" Value="True" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="emboss" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
|
|
|
|
<Setter Property="Background" TargetName="slot" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
|
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
2026-01-02 17:30:30 +08:00
|
|
|
<Style TargetType="{x:Type ToggleButton}" x:Key="DefaultToggleButtonStyle">
|
2025-12-23 21:35:54 +08:00
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
|
|
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="Padding" Value="12,8" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
|
|
|
<Border
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
CornerRadius="{TemplateBinding assist:ControlAssist.CornerRadius}"
|
|
|
|
|
Margin="0"
|
|
|
|
|
x:Name="Border">
|
2025-12-23 21:35:54 +08:00
|
|
|
<ContentPresenter
|
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
Margin="{TemplateBinding Padding}"
|
2025-12-23 21:35:54 +08:00
|
|
|
RecognizesAccessKey="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
x:Name="contentPresenter" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="Button.IsDefaulted" Value="True" />
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextPrimaryBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundPressedBrush}" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsChecked" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextAccentBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
<Setter Property="Background" Value="{DynamicResource PrimaryFocusedBrush}" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsChecked" Value="True" />
|
|
|
|
|
<Condition Property="IsPressed" Value="True" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource PrimaryPressedBrush}" />
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsChecked" Value="True" />
|
|
|
|
|
<Condition Property="IsEnabled" Value="False" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource PrimaryDisabledBrush}" />
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</MultiTrigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<!-- 工具栏按钮 -->
|
2026-01-02 17:30:30 +08:00
|
|
|
<Style TargetType="{x:Type ToggleButton}" x:Key="{x:Static ToolBar.ToggleButtonStyleKey}">
|
2025-12-23 21:35:54 +08:00
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
|
|
|
|
<Setter Property="Background" Value="Transparent" />
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
|
|
<Setter Property="Padding" Value="4,2" />
|
|
|
|
|
<Setter Property="Margin" Value="1,2" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
|
|
|
|
<Border
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
2026-01-02 17:30:30 +08:00
|
|
|
CornerRadius="4"
|
|
|
|
|
x:Name="border">
|
2025-12-23 21:35:54 +08:00
|
|
|
<ContentPresenter
|
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
Margin="{TemplateBinding Padding}"
|
2025-12-23 21:35:54 +08:00
|
|
|
RecognizesAccessKey="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
x:Name="contentPresenter" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsChecked" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="border" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="Button.IsDefaulted" Value="True" />
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="border" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="border" Value="{DynamicResource ControlBackgroundPressedBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
2026-01-02 17:30:30 +08:00
|
|
|
<Setter Property="Background" TargetName="border" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
|
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
|
2025-12-23 21:35:54 +08:00
|
|
|
</Trigger>
|
|
|
|
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
<Style BasedOn="{StaticResource DefaultToggleButtonStyle}" TargetType="ToggleButton" />
|
|
|
|
|
|
|
|
|
|
<!--#endregion-->
|
|
|
|
|
</ResourceDictionary>
|