83 lines
4.9 KiB
XML
83 lines
4.9 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:controls="clr-namespace:AntDesign.WPF.Controls"
|
|
xmlns:helpers="clr-namespace:AntDesign.WPF.Helpers"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Converters.xaml" />
|
|
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Animations.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<Style TargetType="{x:Type controls:CheckableTag}">
|
|
<Setter Property="Padding" Value="8,4" />
|
|
<Setter Property="Margin" Value="0,0,8,0" />
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<Setter Property="FontSize" Value="{DynamicResource TagFontSize}" />
|
|
<Setter Property="FontFamily" Value="{DynamicResource FontFamily}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource TagDefaultForeground}" />
|
|
<Setter Property="helpers:AntdControl.CornerRadius" Value="{DynamicResource BorderRadiusBase}" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type controls:CheckableTag}">
|
|
<controls:AntdBorder
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderStyle="{TemplateBinding helpers:AntdControl.BorderStyle}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}"
|
|
Padding="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
UseLayoutRounding="True"
|
|
x:Name="Border">
|
|
<!-- Content -->
|
|
<ContentPresenter
|
|
Content="{TemplateBinding Content}"
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
|
|
<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>
|
|
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.85" />
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Disabled" />
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
</controls:AntdBorder>
|
|
<ControlTemplate.Triggers>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsChecked" Value="True" />
|
|
<Condition Property="IsPressed" Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Background" TargetName="Border" Value="{Binding Background, Mode=OneWay, ConverterParameter=7, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource ColorPaletteConverter}}" />
|
|
</MultiTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}" />
|
|
</Trigger>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter Property="Foreground" Value="White" />
|
|
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
</ResourceDictionary> |