整理代码

This commit is contained in:
GG Z
2026-02-20 15:31:44 +08:00
parent 94cf3f3266
commit 9f121cfc7f
149 changed files with 4063 additions and 6964 deletions

View File

@@ -1,9 +1,9 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations">
<Style TargetType="{x:Type RadioButton}" x:Key="EmbossRadioButtonStyle">
<Style x:Key="EmbossRadioButtonStyle" TargetType="{x:Type RadioButton}">
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
@@ -13,78 +13,78 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Grid
x:Name="templateRoot"
Background="Transparent"
SnapsToDevicePixels="True"
x:Name="templateRoot">
SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<decorations:EmbossBorder
Background="{TemplateBinding Background}"
CornerRadius="8"
x:Name="radioButtonBorder"
Width="24"
Height="24"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
CornerRadius="8"
Intensity="0.4"
RenderTransformOrigin="0.5,0.5"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Width="24"
x:Name="radioButtonBorder" />
RenderTransformOrigin="0.5,0.5" />
<decorations:SlotBorder
Background="{TemplateBinding Background}"
CornerRadius="8"
x:Name="markSlot"
Grid.Column="0"
Width="24"
Height="24"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Intensity="0.2"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Visibility="Collapsed"
Width="24"
x:Name="markSlot">
Background="{TemplateBinding Background}"
CornerRadius="8"
Intensity="0.2"
Visibility="Collapsed">
<Ellipse
Fill="{DynamicResource PrimaryNormalBrush}"
Margin="1"
MinHeight="6"
x:Name="optionMark"
MinWidth="6"
x:Name="optionMark" />
MinHeight="6"
Margin="1"
Fill="{DynamicResource PrimaryNormalBrush}" />
</decorations:SlotBorder>
<ContentPresenter
Focusable="False"
x:Name="contentPresenter"
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="contentPresenter" />
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter Property="Visibility" TargetName="radioButtonBorder" Value="Collapsed" />
<Setter Property="Visibility" TargetName="markSlot" Value="Visible" />
<Setter TargetName="radioButtonBorder" Property="Visibility" Value="Collapsed" />
<Setter TargetName="markSlot" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="HasContent" Value="true">
<Setter Property="FocusVisualStyle" Value="{DynamicResource OptionMarkFocusVisual}" />
<Setter Property="Padding" Value="4,-1,0,0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="radioButtonBorder" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter Property="Fill" TargetName="optionMark" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter TargetName="optionMark" Property="Fill" Value="{DynamicResource PrimaryFocusedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="ShaderEnabled" TargetName="radioButtonBorder" Value="False" />
<Setter Property="Background" TargetName="radioButtonBorder" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
<Setter Property="ShaderEnabled" TargetName="markSlot" Value="False" />
<Setter Property="ShaderEnabled" TargetName="markSlot" Value="False" />
<Setter Property="Background" TargetName="markSlot" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter Property="Fill" TargetName="optionMark" Value="{DynamicResource PrimaryDisabledBrush}" />
<Setter TargetName="radioButtonBorder" Property="ShaderEnabled" Value="False" />
<Setter TargetName="radioButtonBorder" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
<Setter TargetName="markSlot" Property="ShaderEnabled" Value="False" />
<Setter TargetName="markSlot" Property="ShaderEnabled" Value="False" />
<Setter TargetName="markSlot" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter TargetName="optionMark" Property="Fill" Value="{DynamicResource PrimaryDisabledBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="RenderTransform" TargetName="radioButtonBorder">
<Setter TargetName="radioButtonBorder" Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="0.9" ScaleY="0.9" />
</Setter.Value>
@@ -107,80 +107,80 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Grid
x:Name="templateRoot"
Background="Transparent"
SnapsToDevicePixels="True"
x:Name="templateRoot">
SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
x:Name="radioButtonBorder"
Width="18"
Height="18"
Margin="3,2"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="9"
Height="18"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="3,2"
RenderTransformOrigin="0.5,0.5"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Width="18"
x:Name="radioButtonBorder">
<Grid Margin="3" x:Name="markGrid">
RenderTransformOrigin="0.5,0.5">
<Grid x:Name="markGrid" Margin="3">
<Ellipse
x:Name="optionMark"
MinWidth="6"
MinHeight="6"
Fill="{DynamicResource PrimaryNormalBrush}"
MinHeight="6"
MinWidth="6"
Opacity="0"
x:Name="optionMark" />
Opacity="0" />
<Ellipse
MinHeight="6"
x:Name="indeterminateMark"
MinWidth="6"
MinHeight="6"
Opacity="0"
Stroke="{DynamicResource PrimaryNormalBrush}"
StrokeThickness="2"
x:Name="indeterminateMark" />
StrokeThickness="2" />
</Grid>
</Border>
<ContentPresenter
Focusable="False"
x:Name="contentPresenter"
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="contentPresenter" />
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Opacity" TargetName="optionMark" Value="1" />
<Setter TargetName="optionMark" Property="Opacity" Value="1" />
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter Property="Opacity" TargetName="indeterminateMark" Value="1" />
<Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
</Trigger>
<Trigger Property="HasContent" Value="true">
<Setter Property="FocusVisualStyle" Value="{DynamicResource OptionMarkFocusVisual}" />
<Setter Property="Padding" Value="4,-1,0,0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="radioButtonBorder" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter Property="Fill" TargetName="optionMark" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter Property="Stroke" TargetName="indeterminateMark" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter TargetName="optionMark" Property="Fill" Value="{DynamicResource PrimaryFocusedBrush}" />
<Setter TargetName="indeterminateMark" Property="Stroke" Value="{DynamicResource PrimaryFocusedBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="RenderTransform" TargetName="radioButtonBorder">
<Setter TargetName="radioButtonBorder" Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="0.9" ScaleY="0.9" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="BorderBrush" TargetName="radioButtonBorder" Value="{DynamicResource BorderDisabledBrush}" />
<Setter Property="Stroke" TargetName="indeterminateMark" Value="{DynamicResource PrimaryDisabledBrush}" />
<Setter Property="Fill" TargetName="optionMark" Value="{DynamicResource PrimaryDisabledBrush}" />
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
<Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{DynamicResource BorderDisabledBrush}" />
<Setter TargetName="indeterminateMark" Property="Stroke" Value="{DynamicResource PrimaryDisabledBrush}" />
<Setter TargetName="optionMark" Property="Fill" Value="{DynamicResource PrimaryDisabledBrush}" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -188,7 +188,7 @@
</Setter>
</Style>
<Style TargetType="{x:Type RadioButton}" x:Key="{x:Static ToolBar.RadioButtonStyleKey}">
<Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" TargetType="{x:Type RadioButton}">
<Setter Property="Margin" Value="1,3" />
<Setter Property="Padding" Value="4,1" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
@@ -198,34 +198,34 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border
x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
x:Name="border">
CornerRadius="4">
<ContentPresenter
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="contentPresenter" />
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter Property="Background" TargetName="border" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
<Setter TargetName="border" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}" />
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{DynamicResource ControlBackgroundHoverBrush}" />
<Setter TargetName="border" Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{DynamicResource ControlBackgroundPressedBrush}" />
<Setter TargetName="border" Property="Background" Value="{DynamicResource ControlBackgroundPressedBrush}" />
</Trigger>
</ControlTemplate.Triggers>