126 lines
8.4 KiB
Plaintext
126 lines
8.4 KiB
Plaintext
|
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||
|
|
|
||
|
|
<ResourceDictionary.MergedDictionaries>
|
||
|
|
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Animations.xaml" />
|
||
|
|
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Control.xaml" />
|
||
|
|
</ResourceDictionary.MergedDictionaries>
|
||
|
|
|
||
|
|
<Style x:Key="Ant.RadioButton" BasedOn="{StaticResource Ant.Control}" TargetType="{x:Type RadioButton}">
|
||
|
|
<Setter Property="Padding" Value="4 0 8 0" />
|
||
|
|
<Setter Property="BorderThickness" Value="1" />
|
||
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||
|
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrushBase}" />
|
||
|
|
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type RadioButton}">
|
||
|
|
<Grid>
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="Auto" />
|
||
|
|
<ColumnDefinition Width="*" />
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
<!-- Effect -->
|
||
|
|
<Ellipse x:Name="Effect"
|
||
|
|
Opacity="0"
|
||
|
|
RenderTransformOrigin="0.5,0.5"
|
||
|
|
Width="{DynamicResource RadioSize}"
|
||
|
|
Height="{DynamicResource RadioSize}"
|
||
|
|
Stroke="{DynamicResource RadioDotBrush}"
|
||
|
|
StrokeThickness="{TemplateBinding BorderThickness}">
|
||
|
|
<Ellipse.RenderTransform>
|
||
|
|
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||
|
|
</Ellipse.RenderTransform>
|
||
|
|
</Ellipse>
|
||
|
|
<!-- Circle -->
|
||
|
|
<Ellipse x:Name="Inner"
|
||
|
|
Width="{DynamicResource RadioSize}"
|
||
|
|
Height="{DynamicResource RadioSize}"
|
||
|
|
Fill="{TemplateBinding Background}"
|
||
|
|
Stroke="{TemplateBinding BorderBrush}"
|
||
|
|
StrokeThickness="{TemplateBinding BorderThickness}" />
|
||
|
|
<Ellipse x:Name="Dot"
|
||
|
|
Opacity="0"
|
||
|
|
RenderTransformOrigin="0.5,0.5"
|
||
|
|
Width="{DynamicResource RadioDotSize}"
|
||
|
|
Height="{DynamicResource RadioDotSize}"
|
||
|
|
Fill="{DynamicResource RadioDotBrush}">
|
||
|
|
<Ellipse.RenderTransform>
|
||
|
|
<ScaleTransform ScaleX="0" ScaleY="0" />
|
||
|
|
</Ellipse.RenderTransform>
|
||
|
|
</Ellipse>
|
||
|
|
<!-- Content -->
|
||
|
|
<ContentPresenter Grid.Column="1"
|
||
|
|
RecognizesAccessKey="True"
|
||
|
|
Margin="{TemplateBinding Padding}"
|
||
|
|
Content="{TemplateBinding Content}"
|
||
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||
|
|
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
|
||
|
|
<VisualStateManager.VisualStateGroups>
|
||
|
|
<VisualStateGroup x:Name="CheckStates">
|
||
|
|
<VisualState x:Name="Checked">
|
||
|
|
<Storyboard>
|
||
|
|
<DoubleAnimation Storyboard.TargetName="Dot"
|
||
|
|
Storyboard.TargetProperty="Opacity"
|
||
|
|
EasingFunction="{StaticResource EaseInOutCirc}"
|
||
|
|
Duration="0:0:0.2"
|
||
|
|
To="1" />
|
||
|
|
<DoubleAnimation Storyboard.TargetName="Dot"
|
||
|
|
Storyboard.TargetProperty="RenderTransform.ScaleX"
|
||
|
|
EasingFunction="{StaticResource EaseInOutCirc}"
|
||
|
|
Duration="0:0:0.2"
|
||
|
|
To="1" />
|
||
|
|
<DoubleAnimation Storyboard.TargetName="Dot"
|
||
|
|
Storyboard.TargetProperty="RenderTransform.ScaleY"
|
||
|
|
EasingFunction="{StaticResource EaseInOutCirc}"
|
||
|
|
Duration="0:0:0.2"
|
||
|
|
To="1" />
|
||
|
|
<!-- Effect -->
|
||
|
|
<DoubleAnimation Storyboard.TargetName="Effect"
|
||
|
|
Storyboard.TargetProperty="Opacity"
|
||
|
|
EasingFunction="{StaticResource EaseInOut}"
|
||
|
|
Duration="0:0:0.36"
|
||
|
|
From="0.4"
|
||
|
|
To="0" />
|
||
|
|
<DoubleAnimation Storyboard.TargetName="Effect"
|
||
|
|
Storyboard.TargetProperty="RenderTransform.ScaleX"
|
||
|
|
EasingFunction="{StaticResource EaseInOut}"
|
||
|
|
Duration="0:0:0.36"
|
||
|
|
To="1.6" />
|
||
|
|
<DoubleAnimation Storyboard.TargetName="Effect"
|
||
|
|
Storyboard.TargetProperty="RenderTransform.ScaleY"
|
||
|
|
EasingFunction="{StaticResource EaseInOut}"
|
||
|
|
Duration="0:0:0.36"
|
||
|
|
To="1.6" />
|
||
|
|
</Storyboard>
|
||
|
|
</VisualState>
|
||
|
|
<VisualState x:Name="Unchecked" />
|
||
|
|
<VisualState x:Name="Indeterminate" />
|
||
|
|
</VisualStateGroup>
|
||
|
|
</VisualStateManager.VisualStateGroups>
|
||
|
|
</Grid>
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<Trigger Property="IsMouseOver" Value="True">
|
||
|
|
<Setter TargetName="Inner" Property="Stroke" Value="{DynamicResource RadioDotBrush}" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsChecked" Value="True">
|
||
|
|
<Setter TargetName="Inner" Property="Stroke" Value="{DynamicResource RadioDotBrush}" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsEnabled" Value="False">
|
||
|
|
<Setter TargetName="Dot" Property="Fill" Value="#CCCCCC" />
|
||
|
|
<Setter Property="Foreground" Value="{DynamicResource DisabledBrush}" />
|
||
|
|
<Setter TargetName="Inner" Property="Fill" Value="{DynamicResource InputDisabledBackground}" />
|
||
|
|
<Setter TargetName="Inner" Property="Stroke" Value="{DynamicResource BorderBrushBase}" />
|
||
|
|
</Trigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
</ResourceDictionary>
|