87 lines
5.4 KiB
XML
87 lines
5.4 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:controls="clr-namespace:AntdWpf.Controls"
|
|
xmlns:helpers="clr-namespace:AntdWpf.Helpers">
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Converters.xaml" />
|
|
<ResourceDictionary Source="pack://application:,,,/AntdWpf;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:Control.CornerRadius" Value="{DynamicResource BorderRadiusBase}" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type controls:CheckableTag}">
|
|
<controls:Border x:Name="Border"
|
|
UseLayoutRounding="True"
|
|
Padding="{TemplateBinding Padding}"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
BorderStyle="{TemplateBinding helpers:Control.BorderStyle}"
|
|
CornerRadius="{TemplateBinding helpers:Control.CornerRadius}">
|
|
<!-- Content -->
|
|
<ContentPresenter Content="{TemplateBinding Content}"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
|
|
|
|
<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:Border>
|
|
<ControlTemplate.Triggers>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsChecked" Value="True" />
|
|
<Condition Property="IsPressed" Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter TargetName="Border"
|
|
Property="Background"
|
|
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> |