整理代码

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,10 +1,10 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Melskin.Controls"
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations">
<Style TargetType="{x:Type controls:ChooseBox}" x:Key="SlotChooseBoxStyle">
<Style x:Key="SlotChooseBoxStyle" TargetType="{x:Type controls:ChooseBox}">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
<Setter Property="Border.CornerRadius" Value="4" />
<Setter Property="BorderBrush" Value="Transparent" />
@@ -29,53 +29,53 @@
<ControlTemplate TargetType="{x:Type controls:ChooseBox}">
<Grid>
<decorations:SlotBorder
x:Name="ContentBorder"
MinWidth="{TemplateBinding MinWidth}"
MinHeight="{TemplateBinding MinHeight}"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding Border.CornerRadius}"
HorizontalAlignment="Stretch"
Intensity="0.2"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="0"
VerticalAlignment="Stretch"
x:Name="ContentBorder">
Intensity="0.2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<TextBlock
FontSize="{TemplateBinding FontSize}"
Foreground="{DynamicResource TextPlaceholderBrush}"
Name="PlaceholderTextBlock"
Grid.Column="0"
Margin="5,0,0,0"
Name="PlaceholderTextBlock"
Text="{TemplateBinding PlaceholderText}"
VerticalAlignment="Center"
FontSize="{TemplateBinding FontSize}"
Foreground="{DynamicResource TextPlaceholderBrush}"
Text="{TemplateBinding PlaceholderText}"
Visibility="Collapsed" />
<ScrollViewer
x:Name="PART_ContentHost"
Grid.Column="0"
Margin="{TemplateBinding Padding}"
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
Foreground="{TemplateBinding Foreground}"
Grid.Column="0"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsTabStop="{TemplateBinding ScrollViewer.IsTabStop}"
Margin="{TemplateBinding Padding}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
x:Name="PART_ContentHost" />
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
<Button
x:Name="PART_ChooseButton"
Grid.Column="1"
Width="{TemplateBinding ChooseButtonWidth}"
Padding="0,0,4,0"
Background="Transparent"
Foreground="{DynamicResource TextSecondaryBrush}"
Grid.Column="1"
Padding="0,0,4,0"
Style="{DynamicResource FlattenButtonStyle}"
Width="{TemplateBinding ChooseButtonWidth}"
x:Name="PART_ChooseButton">
Style="{DynamicResource FlattenButtonStyle}">
<controls:IconElement
x:Name="icon"
Foreground="{DynamicResource TextSecondaryBrush}"
Symbol="MoreHoriz"
x:Name="icon" />
Symbol="MoreHoriz" />
</Button>
</Grid>
</decorations:SlotBorder>
@@ -101,16 +101,16 @@
<Condition Property="UIElement.IsMouseOver" Value="True" />
<!--<Condition Property="UIElement.IsFocused" Value="False" />-->
</MultiTrigger.Conditions>
<Setter Property="Intensity" TargetName="ContentBorder" Value="0.5" />
<Setter TargetName="ContentBorder" Property="Intensity" Value="0.5" />
</MultiTrigger>
<Trigger Property="Text" Value="">
<Setter Property="Visibility" TargetName="PlaceholderTextBlock" Value="Visible" />
<Setter TargetName="PlaceholderTextBlock" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter Property="ShaderEnabled" TargetName="ContentBorder" Value="False" />
<Setter TargetName="ContentBorder" Property="ShaderEnabled" Value="False" />
<!--<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />-->
<!--<Setter Property="BorderBrush" TargetName="AccentBorder" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />-->
@@ -159,51 +159,51 @@
<ControlTemplate TargetType="{x:Type controls:ChooseBox}">
<Grid>
<Border
x:Name="ContentBorder"
MinWidth="{TemplateBinding MinWidth}"
MinHeight="{TemplateBinding MinHeight}"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding Border.CornerRadius}"
HorizontalAlignment="Stretch"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="0"
VerticalAlignment="Stretch"
x:Name="ContentBorder">
CornerRadius="{TemplateBinding Border.CornerRadius}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<TextBlock
Name="PlaceholderTextBlock"
Margin="5,0,0,0"
VerticalAlignment="Center"
FontSize="{TemplateBinding FontSize}"
Foreground="{DynamicResource TextPlaceholderBrush}"
Margin="5,0,0,0"
Name="PlaceholderTextBlock"
Text="{TemplateBinding PlaceholderText}"
VerticalAlignment="Center"
Visibility="Collapsed" />
<ScrollViewer
x:Name="PART_ContentHost"
Grid.Column="0"
Margin="{TemplateBinding Padding}"
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
Foreground="{TemplateBinding Foreground}"
Grid.Column="0"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsTabStop="{TemplateBinding ScrollViewer.IsTabStop}"
Margin="{TemplateBinding Padding}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
x:Name="PART_ContentHost" />
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
<Button
x:Name="PART_ChooseButton"
Grid.Column="1"
Width="{TemplateBinding ChooseButtonWidth}"
Padding="0,0,4,0"
Background="Transparent"
Foreground="{DynamicResource TextSecondaryBrush}"
Grid.Column="1"
Padding="0,0,4,0"
Style="{DynamicResource FlattenButtonStyle}"
Width="{TemplateBinding ChooseButtonWidth}"
x:Name="PART_ChooseButton">
Style="{DynamicResource FlattenButtonStyle}">
<controls:IconElement
x:Name="icon"
Foreground="{DynamicResource TextSecondaryBrush}"
Symbol="MoreHoriz"
x:Name="icon" />
Symbol="MoreHoriz" />
</Button>
</Grid>
</Border>
@@ -218,20 +218,20 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="True" />
<Condition Property="UIElement.IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlBackgroundHoverBrush}" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
</MultiTrigger>
<Trigger Property="Text" Value="">
<Setter Property="Visibility" TargetName="PlaceholderTextBlock" Value="Visible" />
<Setter TargetName="PlaceholderTextBlock" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">