Files
Shrlalgo.RvKits/Melskin/Controls/CheckableTag.xaml

86 lines
4.9 KiB
Plaintext
Raw Normal View History

2025-07-31 20:12:01 +08:00
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2026-02-20 15:31:44 +08:00
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2026-01-02 17:30:41 +08:00
xmlns:controls="clr-namespace:Melskin.Controls"
2026-02-20 15:31:44 +08:00
xmlns:helpers="clr-namespace:Melskin.Assists">
2025-07-11 09:20:23 +08:00
<ResourceDictionary.MergedDictionaries>
2026-01-02 17:30:41 +08:00
<ResourceDictionary Source="/Melskin;component/Themes/Animations.xaml" />
2025-07-11 09:20:23 +08:00
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type controls:CheckableTag}">
2025-07-31 20:12:01 +08:00
<Setter Property="Padding" Value="8,4" />
2025-07-11 09:20:23 +08:00
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
2025-12-23 21:35:54 +08:00
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
2025-07-11 09:20:23 +08:00
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
2025-08-12 23:08:54 +08:00
<Setter Property="FontSize" Value="12" />
<!--<Setter Property="FontFamily" Value="{DynamicResource FontFamily}" />-->
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="helpers:ControlAssist.CornerRadius" Value="4" />
2025-07-11 09:20:23 +08:00
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:CheckableTag}">
2025-08-12 23:08:54 +08:00
<Border
2026-02-20 15:31:44 +08:00
x:Name="Border"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
2025-07-31 20:12:01 +08:00
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
2025-08-12 23:08:54 +08:00
CornerRadius="{TemplateBinding helpers:ControlAssist.CornerRadius}"
2025-07-31 20:12:01 +08:00
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
2026-02-20 15:31:44 +08:00
UseLayoutRounding="True">
2025-07-31 20:12:01 +08:00
<!-- Content -->
<ContentPresenter
2026-02-20 15:31:44 +08:00
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
2025-07-31 20:12:01 +08:00
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
2026-02-20 15:31:44 +08:00
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
2025-07-11 09:20:23 +08:00
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.3" GeneratedEasingFunction="{StaticResource EaseOut}" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
2025-07-31 20:12:01 +08:00
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.85" />
2025-07-11 09:20:23 +08:00
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
2025-08-12 23:08:54 +08:00
</Border>
2025-07-11 09:20:23 +08:00
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="True" />
<Condition Property="IsPressed" Value="True" />
</MultiTrigger.Conditions>
2026-02-20 15:31:44 +08:00
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
2025-07-11 09:20:23 +08:00
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
2025-07-11 09:20:23 +08:00
</Trigger>
<Trigger Property="IsChecked" Value="True">
2025-09-12 09:55:36 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextAccentBrush}" />
2025-08-12 23:08:54 +08:00
<Setter Property="Background" Value="{DynamicResource PrimaryNormalBrush}" />
2025-07-11 09:20:23 +08:00
</Trigger>
</Style.Triggers>
</Style>
2025-07-31 20:12:01 +08:00
2025-07-11 09:20:23 +08:00
</ResourceDictionary>