Files
better-genshin-impact/Build/MicaSetup/Design/Controls/CheckBox/CheckBox.xaml

76 lines
4.1 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:design="clr-namespace:MicaSetup.Design"
xmlns:local="clr-namespace:MicaSetup.Design.Controls">
<ResourceDictionary.MergedDictionaries>
<design:ResourceResourceDictionary />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="DefaultCheckBoxStyle"
BasedOn="{StaticResource {x:Type CheckBox}}"
TargetType="{x:Type CheckBox}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Padding" Value="4,0,0,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<StackPanel Orientation="Horizontal">
<Grid Width="20"
Height="20"
Background="Transparent">
<Border x:Name="border"
Width="20"
Height="20"
Margin="0,0,0,0"
BorderBrush="#8E8E93"
BorderThickness="1"
CornerRadius="2" />
<TextBlock x:Name="checkIcon"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{StaticResource IcoMoon}"
FontSize="18"
Foreground="{DynamicResource HighGreenBrush}"
Opacity="0"
Text="{x:Static local:Selection.PublicOk}" />
</Grid>
<ContentPresenter Margin="5,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<BeginStoryboard.Storyboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="checkIcon"
Storyboard.TargetProperty="(UIElement.Opacity)"
To="1"
Duration="0:0:0.05" />
</Storyboard>
</BeginStoryboard.Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<BeginStoryboard.Storyboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="checkIcon"
Storyboard.TargetProperty="(UIElement.Opacity)"
To="0"
Duration="0:0:0.05" />
</Storyboard>
</BeginStoryboard.Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultCheckBoxStyle}" TargetType="{x:Type CheckBox}" />
</ResourceDictionary>