This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -1,9 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFluent.Controls"
xmlns:converters="clr-namespace:WPFluent.Converters"
xmlns:system="clr-namespace:System;assembly=mscorlib">
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Thickness x:Key="CheckBoxPadding">11,5,11,6</Thickness>
<Thickness x:Key="CheckBoxBorderThemeThickness">1</Thickness>
@@ -12,13 +11,13 @@
<system:Double x:Key="CheckBoxHeight">22</system:Double>
<system:Double x:Key="CheckBoxWidth">22</system:Double>
<Style x:Key="DefaultCheckBoxStyle" TargetType="{x:Type CheckBox}">
<Style TargetType="{x:Type CheckBox}" x:Key="DefaultCheckBoxStyle">
<!-- Universal WPF UI focus -->
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<!-- Universal WPF UI focus -->
<Setter Property="Background" Value="{DynamicResource CheckBoxBackground}" />
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlAltFillColorSecondaryBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrongStrokeColorDefaultBrush}" />
<Setter Property="BorderThickness" Value="{StaticResource CheckBoxBorderThemeThickness}" />
<Setter Property="Padding" Value="{StaticResource CheckBoxPadding}" />
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
@@ -39,92 +38,92 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<BulletDecorator
Background="Transparent"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="Transparent">
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<BulletDecorator.Bullet>
<Border
x:Name="ControlBorderIconPresenter"
Width="{StaticResource CheckBoxHeight}"
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding Border.CornerRadius}"
Height="{StaticResource CheckBoxWidth}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding Border.CornerRadius}">
Width="{StaticResource CheckBoxHeight}"
x:Name="ControlBorderIconPresenter">
<Border
x:Name="StrokeBorder"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding Border.CornerRadius}">
CornerRadius="{TemplateBinding Border.CornerRadius}"
x:Name="StrokeBorder">
<Grid>
<controls:SymbolIcon
x:Name="ControlIcon"
Margin="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="{StaticResource CheckBoxIconSize}"
FontWeight="Bold"
Foreground="{DynamicResource CheckBoxCheckGlyphForeground}"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
HorizontalAlignment="Center"
Margin="0"
Symbol="Checkmark48"
Visibility="Collapsed" />
VerticalAlignment="Center"
Visibility="Collapsed"
x:Name="ControlIcon" />
</Grid>
</Border>
</Border>
</BulletDecorator.Bullet>
<ContentPresenter
x:Name="ContentPresenter"
Margin="{StaticResource CheckBoxContentMargin}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{StaticResource CheckBoxContentMargin}"
RecognizesAccessKey="True"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RecognizesAccessKey="True" />
x:Name="ContentPresenter" />
</BulletDecorator>
<ControlTemplate.Triggers>
<Trigger Property="Content" Value="{x:Null}">
<Setter TargetName="ContentPresenter" Property="Margin" Value="0" />
<Setter Property="Margin" TargetName="ContentPresenter" Value="0" />
<Setter Property="MinWidth" Value="30" />
</Trigger>
<Trigger Property="Content" Value="">
<Setter TargetName="ContentPresenter" Property="Margin" Value="0" />
<Setter Property="Margin" TargetName="ContentPresenter" Value="0" />
<Setter Property="MinWidth" Value="30" />
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter TargetName="ControlIcon" Property="Symbol" Value="Subtract16" />
<Setter TargetName="ControlIcon" Property="Visibility" Value="Visible" />
<Setter TargetName="ControlBorderIconPresenter" Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillChecked}" />
<Setter TargetName="StrokeBorder" Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBorderBrush}" />
<Setter Property="Symbol" TargetName="ControlIcon" Value="Subtract16" />
<Setter Property="Visibility" TargetName="ControlIcon" Value="Visible" />
<Setter Property="Background" TargetName="ControlBorderIconPresenter" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="BorderBrush" TargetName="StrokeBorder" Value="{DynamicResource SubtleFillColorTransparentBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="ControlIcon" Property="Visibility" Value="Visible" />
<Setter TargetName="ControlBorderIconPresenter" Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillChecked}" />
<Setter TargetName="StrokeBorder" Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBorderBrush}" />
<Setter Property="Visibility" TargetName="ControlIcon" Value="Visible" />
<Setter Property="Background" TargetName="ControlBorderIconPresenter" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="BorderBrush" TargetName="StrokeBorder" Value="{DynamicResource SubtleFillColorTransparentBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsChecked" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="StrokeBorder" Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUncheckedPointerOver}" />
<Setter Property="Background" TargetName="StrokeBorder" Value="{DynamicResource ControlAltFillColorTertiaryBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsChecked" Value="{x:Null}" />
</MultiTrigger.Conditions>
<Setter TargetName="ControlBorderIconPresenter" Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedPointerOver}" />
<Setter TargetName="StrokeBorder" Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBorderBrush}" />
<Setter Property="Background" TargetName="ControlBorderIconPresenter" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="BorderBrush" TargetName="StrokeBorder" Value="{DynamicResource SubtleFillColorTransparentBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsChecked" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="ControlBorderIconPresenter" Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedPointerOver}" />
<Setter TargetName="StrokeBorder" Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBorderBrush}" />
<Setter Property="Background" TargetName="ControlBorderIconPresenter" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="BorderBrush" TargetName="StrokeBorder" Value="{DynamicResource SubtleFillColorTransparentBrush}" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ControlBorderIconPresenter" Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUncheckedDisabled}" />
<Setter TargetName="StrokeBorder" Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeUncheckedDisabled}" />
<Setter TargetName="ControlIcon" Property="Foreground" Value="{DynamicResource CheckBoxForegroundUncheckedDisabled}" />
<Setter Property="Background" TargetName="ControlBorderIconPresenter" Value="{DynamicResource ControlAltFillColorDisabledBrush}" />
<Setter Property="BorderBrush" TargetName="StrokeBorder" Value="{DynamicResource ControlStrongStrokeColorDisabledBrush}" />
<Setter Property="Foreground" TargetName="ControlIcon" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>