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,14 +1,14 @@
<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:controls="clr-namespace:WPFluent.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<!--<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Resources/DesignTime.xaml" />-->
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Resources/Variables.xaml" />
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Controls/TextBox/TextBox.xaml" />
</ResourceDictionary.MergedDictionaries>
<PathGeometry x:Key="icon" Figures="M147.01175 430.890704c-44.791136 0-81.108273 36.303834-81.108273 81.109296 0 44.778856 36.316114 81.108273 81.108273 81.108273 44.792159 0 81.109296-36.329417 81.109296-81.108273C228.121046 467.194538 191.804932 430.890704 147.01175 430.890704zM511.999488 430.890704c-44.791136 0-81.108273 36.303834-81.108273 81.109296 0 44.778856 36.316114 81.108273 81.108273 81.108273 44.792159 0 81.109296-36.329417 81.109296-81.108273C593.108784 467.194538 556.791647 430.890704 511.999488 430.890704zM876.987227 430.890704c-44.791136 0-81.108273 36.303834-81.108273 81.109296 0 44.778856 36.316114 81.108273 81.108273 81.108273s81.108273-36.329417 81.108273-81.108273C958.094476 467.194538 921.778362 430.890704 876.987227 430.890704z" />
<Style x:Key="ChooseButtonStyle" TargetType="Button">
<PathGeometry Figures="M147.01175 430.890704c-44.791136 0-81.108273 36.303834-81.108273 81.109296 0 44.778856 36.316114 81.108273 81.108273 81.108273 44.792159 0 81.109296-36.329417 81.109296-81.108273C228.121046 467.194538 191.804932 430.890704 147.01175 430.890704zM511.999488 430.890704c-44.791136 0-81.108273 36.303834-81.108273 81.109296 0 44.778856 36.316114 81.108273 81.108273 81.108273 44.792159 0 81.109296-36.329417 81.109296-81.108273C593.108784 467.194538 556.791647 430.890704 511.999488 430.890704zM876.987227 430.890704c-44.791136 0-81.108273 36.303834-81.108273 81.109296 0 44.778856 36.316114 81.108273 81.108273 81.108273s81.108273-36.329417 81.108273-81.108273C958.094476 467.194538 921.778362 430.890704 876.987227 430.890704z" x:Key="Icon" />
<Style TargetType="Button" x:Key="ChooseButtonStyle">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
@@ -19,18 +19,18 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Path
x:Name="icon"
Width="12"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Data="{StaticResource icon}"
Data="{StaticResource Icon}"
Fill="{DynamicResource TextControlElevationBorderBrush}"
Stretch="Uniform" />
HorizontalAlignment="Left"
Stretch="Uniform"
VerticalAlignment="Center"
Width="12"
x:Name="icon" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Cursor" Value="Hand" />
<Setter TargetName="icon" Property="Fill" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}" />
<Setter Property="Fill" TargetName="icon" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -38,15 +38,15 @@
</Setter>
</Style>
<Style TargetType="{x:Type controls:ChooseBox}">
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
<Setter Property="Border.CornerRadius" Value="{StaticResource ControlCornerRadius}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="{StaticResource TextBoxBorderThemeThickness}" />
<Setter Property="ChooseButtonWidth" Value="20" />
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="FrameworkElement.ContextMenu" Value="{DynamicResource DefaultControlContextMenu}" />
<Setter Property="FrameworkElement.FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="ContextMenu" Value="{DynamicResource DefaultControlContextMenu}" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="MinHeight" Value="{StaticResource TextControlThemeMinHeight}" />
@@ -62,56 +62,57 @@
<ControlTemplate TargetType="{x:Type controls:ChooseBox}">
<Grid>
<Border
MinWidth="{TemplateBinding MinWidth}"
MinHeight="{TemplateBinding MinHeight}"
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}"
Name="ContentBorder"
Padding="0">
Padding="0"
VerticalAlignment="Stretch">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<TextBlock
Visibility="Collapsed"
FontSize="{TemplateBinding FontSize}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Margin="0"
VerticalAlignment="Center"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
Name="PlaceholderTextBlock"
Padding="4,0"
Text="{TemplateBinding PlaceholderText}"
TextBlock.FontSize="{TemplateBinding FontSize}" />
VerticalAlignment="Center"
Visibility="Collapsed" />
<controls:PassiveScrollViewer
x:Name="PART_ContentHost"
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}"
ScrollViewer.CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
ScrollViewer.HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
ScrollViewer.VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
Style="{DynamicResource DefaultTextBoxScrollViewerStyle}" />
Margin="{TemplateBinding Padding}"
Style="{DynamicResource DefaultTextBoxScrollViewerStyle}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
x:Name="PART_ContentHost" />
<Button
x:Name="PART_ChooseButton"
Grid.Column="1"
Width="{TemplateBinding ChooseButtonWidth}"
Foreground="{TemplateBinding Foreground}"
Style="{StaticResource ChooseButtonStyle}" />
Grid.Column="1"
Style="{StaticResource ChooseButtonStyle}"
Width="{TemplateBinding ChooseButtonWidth}"
x:Name="PART_ChooseButton" />
</Grid>
</Border>
<Border
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
BorderThickness="{StaticResource TextBoxAccentBorderThemeThickness}"
CornerRadius="{TemplateBinding Border.CornerRadius}"
Name="AccentBorder" />
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch"
Name="AccentBorder"
VerticalAlignment="Stretch" />
</Grid>
<ControlTemplate.Triggers>
<!--<Trigger Property="IsKeyboardFocused" Value="true">
@@ -126,28 +127,28 @@
<Condition Property="UIElement.IsMouseOver" Value="True" />
<Condition Property="UIElement.IsFocused" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
</MultiTrigger>
<Trigger Property="Text" Value="">
<Setter TargetName="PlaceholderTextBlock" Property="Visibility" Value="Visible" />
<Setter Property="Visibility" TargetName="PlaceholderTextBlock" Value="Visible" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" />
<Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" />
<Setter TargetName="AccentBorder" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorDisabledBrush}" />
<Setter Property="BorderBrush" TargetName="ContentBorder" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="BorderBrush" TargetName="AccentBorder" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="controls:TextBoxEx.ClearButtonEnabled" Value="False" />
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
</Trigger>
<Trigger Property="UIElement.IsFocused" Value="True">
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
<Setter TargetName="AccentBorder" Property="BorderBrush" Value="{DynamicResource TextControlFocusedBorderBrush}" />
<Setter TargetName="AccentBorder" Property="BorderThickness" Value="0,0,0,2" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorInputActiveBrush}" />
<Setter Property="BorderBrush" TargetName="AccentBorder" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="BorderThickness" TargetName="AccentBorder" Value="0,0,0,2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="TextBoxBase.CaretBrush" Value="{DynamicResource TextControlForeground}" />
<Setter Property="CaretBrush" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />