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,21 +1,11 @@
<!--
This Source Code Form is subject to the terms of the MIT License.
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
All Rights Reserved.
Based on Microsoft XAML for Win UI
Copyright (c) Microsoft Corporation. All Rights Reserved.
-->
<ResourceDictionary
<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:system="clr-namespace:System;assembly=mscorlib">
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<!--<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Resources/Variables.xaml" />-->
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Resources/Variables.xaml" />
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Resources/DefaultTextBoxScrollViewerStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<Thickness x:Key="TextBoxBorderThemeThickness">1,1,1,1</Thickness>
<Thickness x:Key="TextBoxAccentBorderThemeThickness">0,0,0,1</Thickness>
@@ -25,16 +15,16 @@
<Thickness x:Key="TextBoxClearButtonPadding">0,0,0,0</Thickness>
<system:Double x:Key="TextBoxClearButtonHeight">24</system:Double>
<Style x:Key="DefaultTextBoxStyle" TargetType="{x:Type TextBox}">
<Style TargetType="{x:Type TextBox}" x:Key="DefaultTextBoxStyle">
<!-- Universal WPF UI focus -->
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<!-- Universal WPF UI focus -->
<!-- Universal WPF UI ContextMenu -->
<Setter Property="ContextMenu" Value="{DynamicResource DefaultControlContextMenu}" />
<!-- Universal WPF UI ContextMenu -->
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="CaretBrush" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="{StaticResource TextBoxBorderThemeThickness}" />
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}" />
@@ -58,45 +48,45 @@
<ControlTemplate TargetType="{x:Type TextBox}">
<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}">
CornerRadius="{TemplateBinding Border.CornerRadius}"
HorizontalAlignment="Stretch"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="0"
VerticalAlignment="Stretch"
x:Name="ContentBorder">
<Grid
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<controls:PassiveScrollViewer
x:Name="PART_ContentHost"
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsTabStop="{TemplateBinding ScrollViewer.IsTabStop}"
Style="{DynamicResource DefaultTextBoxScrollViewerStyle}"
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
x:Name="PART_ContentHost" />
</Grid>
</Border>
<!-- The Accent Border is a separate element so that changes to the border thickness do not affect the position of the element -->
<Border
x:Name="AccentBorder"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
BorderThickness="{StaticResource TextBoxAccentBorderThemeThickness}"
CornerRadius="{TemplateBinding Border.CornerRadius}" />
CornerRadius="{TemplateBinding Border.CornerRadius}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
x:Name="AccentBorder" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="AccentBorder" Property="BorderThickness" Value="0,0,0,2" />
<Setter TargetName="AccentBorder" Property="BorderBrush" Value="{DynamicResource TextControlFocusedBorderBrush}" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
<Setter Property="BorderThickness" TargetName="AccentBorder" Value="0,0,0,2" />
<Setter Property="BorderBrush" TargetName="AccentBorder" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorInputActiveBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
@@ -104,16 +94,16 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsFocused" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Cursor" Value="IBeam" />
</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="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
<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="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -121,28 +111,26 @@
</Setter>
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="BorderBrush"
Value="{DynamicResource PaletteRedBrush}" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemFillColorCriticalBrush}" />
<Setter Property="BorderThickness" Value="1" />
</Trigger>
</Style.Triggers>
</Style>
<ControlTemplate x:Key="DefaultUiTextBoxControlTemplate" TargetType="{x:Type controls:TextBox}">
<ControlTemplate TargetType="{x:Type controls:TextBox}" x:Key="DefaultUiTextBoxControlTemplate">
<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}">
CornerRadius="{TemplateBinding Border.CornerRadius}"
HorizontalAlignment="Stretch"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="0"
VerticalAlignment="Stretch"
x:Name="ContentBorder">
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@@ -152,109 +140,109 @@
</Grid.ColumnDefinitions>
<ContentPresenter
x:Name="ControlIconLeft"
Grid.Column="0"
Margin="{StaticResource TextBoxLeftIconMargin}"
VerticalAlignment="Center"
Content="{TemplateBinding Icon}"
Focusable="False"
Grid.Column="0"
Margin="{StaticResource TextBoxLeftIconMargin}"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.Foreground="{TemplateBinding Foreground}"
Visibility="Visible" />
VerticalAlignment="Center"
Visibility="Visible"
x:Name="ControlIconLeft" />
<Grid Grid.Column="1" Margin="{TemplateBinding Padding}">
<controls:PassiveScrollViewer
x:Name="PART_ContentHost"
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsTabStop="{TemplateBinding ScrollViewer.IsTabStop}"
Style="{DynamicResource DefaultTextBoxScrollViewerStyle}"
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
x:Name="PART_ContentHost" />
<TextBlock
x:Name="PlaceholderTextBox"
FontSize="{TemplateBinding FontSize}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Margin="0"
Padding="1,0"
Text="{TemplateBinding PlaceholderText}"
VerticalAlignment="Center"
FontSize="{TemplateBinding FontSize}"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
Text="{TemplateBinding PlaceholderText}" />
x:Name="PlaceholderTextBox" />
</Grid>
<!-- Buttons and Icons have no padding from the main element to allow absolute positions if height is larger than the text entry zone -->
<controls:Button
x:Name="ClearButton"
Grid.Column="2"
MinWidth="{StaticResource TextBoxClearButtonHeight}"
MinHeight="{StaticResource TextBoxClearButtonHeight}"
Margin="{StaticResource TextBoxClearButtonMargin}"
Padding="{StaticResource TextBoxClearButtonPadding}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Appearance="Secondary"
Appearance="Accent"
Background="Transparent"
BorderBrush="Transparent"
Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}"
Cursor="Arrow"
Foreground="{DynamicResource TextControlButtonForeground}"
IsTabStop="False">
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Grid.Column="2"
HorizontalAlignment="Center"
HorizontalContentAlignment="Center"
IsTabStop="False"
Margin="{StaticResource TextBoxClearButtonMargin}"
MinHeight="{StaticResource TextBoxClearButtonHeight}"
MinWidth="{StaticResource TextBoxClearButtonHeight}"
Padding="{StaticResource TextBoxClearButtonPadding}"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
x:Name="ClearButton">
<controls:Button.Icon>
<controls:SymbolIcon FontSize="{TemplateBinding FontSize}" Symbol="Dismiss24" />
</controls:Button.Icon>
</controls:Button>
<ContentPresenter
x:Name="ControlIconRight"
Content="{TemplateBinding Icon}"
Grid.Column="3"
Margin="{StaticResource TextBoxRightIconMargin}"
VerticalAlignment="Center"
Content="{TemplateBinding Icon}"
TextElement.FontSize="{TemplateBinding FontSize}"
TextElement.Foreground="{TemplateBinding Foreground}" />
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center"
x:Name="ControlIconRight" />
</Grid>
</Border>
<!-- The Accent Border is a separate element so that changes to the border thickness do not affect the position of the element -->
<Border
x:Name="AccentBorder"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
BorderThickness="{StaticResource TextBoxAccentBorderThemeThickness}"
CornerRadius="{TemplateBinding Border.CornerRadius}" />
CornerRadius="{TemplateBinding Border.CornerRadius}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
x:Name="AccentBorder" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="CurrentPlaceholderEnabled" Value="False">
<Setter TargetName="PlaceholderTextBox" Property="Visibility" Value="Collapsed" />
<Setter Property="Visibility" TargetName="PlaceholderTextBox" Value="Collapsed" />
</Trigger>
<Trigger Property="ShowClearButton" Value="False">
<Setter TargetName="ClearButton" Property="Visibility" Value="Collapsed" />
<Setter TargetName="ClearButton" Property="Margin" Value="0" />
<Setter Property="Visibility" TargetName="ClearButton" Value="Collapsed" />
<Setter Property="Margin" TargetName="ClearButton" Value="0" />
</Trigger>
<Trigger Property="ClearButtonEnabled" Value="False">
<Setter TargetName="ClearButton" Property="Visibility" Value="Collapsed" />
<Setter TargetName="ClearButton" Property="Margin" Value="0" />
<Setter Property="Visibility" TargetName="ClearButton" Value="Collapsed" />
<Setter Property="Margin" TargetName="ClearButton" Value="0" />
</Trigger>
<Trigger Property="IconPlacement" Value="Left">
<Setter TargetName="ControlIconRight" Property="Visibility" Value="Collapsed" />
<Setter TargetName="ControlIconRight" Property="Margin" Value="0" />
<Setter Property="Visibility" TargetName="ControlIconRight" Value="Collapsed" />
<Setter Property="Margin" TargetName="ControlIconRight" Value="0" />
</Trigger>
<Trigger Property="IconPlacement" Value="Right">
<Setter TargetName="ControlIconLeft" Property="Visibility" Value="Collapsed" />
<Setter TargetName="ControlIconLeft" Property="Margin" Value="0" />
<Setter Property="Visibility" TargetName="ControlIconLeft" Value="Collapsed" />
<Setter Property="Margin" TargetName="ControlIconLeft" Value="0" />
</Trigger>
<Trigger Property="Icon" Value="{x:Null}">
<Setter TargetName="ControlIconRight" Property="Visibility" Value="Collapsed" />
<Setter TargetName="ControlIconRight" Property="Margin" Value="0" />
<Setter TargetName="ControlIconLeft" Property="Visibility" Value="Collapsed" />
<Setter TargetName="ControlIconLeft" Property="Margin" Value="0" />
<Setter Property="Visibility" TargetName="ControlIconRight" Value="Collapsed" />
<Setter Property="Margin" TargetName="ControlIconRight" Value="0" />
<Setter Property="Visibility" TargetName="ControlIconLeft" Value="Collapsed" />
<Setter Property="Margin" TargetName="ControlIconLeft" Value="0" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="AccentBorder" Property="BorderThickness" Value="0,0,0,2" />
<Setter TargetName="AccentBorder" Property="BorderBrush" Value="{DynamicResource TextControlFocusedBorderBrush}" />
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
<Setter Property="BorderThickness" TargetName="AccentBorder" Value="0,0,0,2" />
<Setter Property="BorderBrush" TargetName="AccentBorder" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorInputActiveBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
@@ -262,69 +250,69 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsFocused" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" />
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
</MultiTrigger>
<Trigger Property="IsReadOnly" Value="True">
<Setter TargetName="ClearButton" Property="Visibility" Value="Collapsed" />
<Setter TargetName="ClearButton" Property="Margin" Value="0" />
<Setter Property="Visibility" TargetName="ClearButton" Value="Collapsed" />
<Setter Property="Margin" TargetName="ClearButton" Value="0" />
</Trigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Cursor" Value="IBeam" />
</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 TargetName="ControlIconLeft" Property="TextElement.Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
<Setter TargetName="ControlIconRight" Property="TextElement.Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
<Setter TargetName="PlaceholderTextBox" Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
<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="TextElement.Foreground" TargetName="ControlIconLeft" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="TextElement.Foreground" TargetName="ControlIconRight" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Foreground" TargetName="PlaceholderTextBox" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="ClearButtonEnabled" Value="False" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="DefaultUiTextBoxTextSelectionEnabledControlTemplate" TargetType="{x:Type controls:TextBox}">
<ControlTemplate TargetType="{x:Type controls:TextBox}" x:Key="DefaultUiTextBoxTextSelectionEnabledControlTemplate">
<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<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}"
Focusable="False">
Focusable="False"
HorizontalAlignment="Stretch"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="0"
VerticalAlignment="Stretch"
x:Name="ContentBorder">
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid Margin="{TemplateBinding Padding}">
<controls:PassiveScrollViewer
x:Name="PART_ContentHost"
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsTabStop="{TemplateBinding ScrollViewer.IsTabStop}"
Style="{DynamicResource DefaultTextBoxScrollViewerStyle}"
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
x:Name="PART_ContentHost" />
</Grid>
</Grid>
</Border>
</Grid>
</ControlTemplate>
<Style x:Key="DefaultUiTextBoxStyle" TargetType="{x:Type controls:TextBox}">
<Style TargetType="{x:Type controls:TextBox}" x:Key="DefaultUiTextBoxStyle">
<!-- Universal WPF UI focus -->
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<!-- Universal WPF UI focus -->
<!-- Universal WPF UI ContextMenu -->
<Setter Property="ContextMenu" Value="{DynamicResource DefaultControlContextMenu}" />
<!-- Universal WPF UI ContextMenu -->
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="CaretBrush" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlElevationBorderBrush}" />
<Setter Property="BorderThickness" Value="{StaticResource TextBoxBorderThemeThickness}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
@@ -358,21 +346,19 @@
<Setter Property="Template" Value="{StaticResource DefaultUiTextBoxTextSelectionEnabledControlTemplate}" />
</Trigger>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="BorderBrush"
Value="{DynamicResource PaletteRedBrush}" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemFillColorCriticalBrush}" />
<Setter Property="BorderThickness" Value="1" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="TransparentTextBoxStyle" TargetType="{x:Type TextBox}">
<Style TargetType="{x:Type TextBox}" x:Key="TransparentTextBoxStyle">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style x:Key="TransparentUiTextBoxStyle" TargetType="{x:Type controls:TextBox}">
<Style TargetType="{x:Type controls:TextBox}" x:Key="TransparentUiTextBoxStyle">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="BorderThickness" Value="0" />
@@ -382,16 +368,16 @@
<ControlTemplate TargetType="{x:Type controls:TextBox}">
<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<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}">
CornerRadius="{TemplateBinding Border.CornerRadius}"
HorizontalAlignment="Stretch"
MinHeight="{TemplateBinding MinHeight}"
MinWidth="{TemplateBinding MinWidth}"
Padding="0"
VerticalAlignment="Stretch"
x:Name="ContentBorder">
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
@@ -400,22 +386,21 @@
<Grid Grid.Column="0" Margin="{TemplateBinding Padding}">
<ScrollViewer
x:Name="PART_ContentHost"
VerticalAlignment="Center"
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
IsTabStop="{TemplateBinding ScrollViewer.IsTabStop}"
Style="{StaticResource DefaultTextBoxScrollViewerStyle}"
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
x:Name="PART_ContentHost" />
<TextBlock
x:Name="PlaceholderTextBox"
Margin="0"
Padding="1,0"
VerticalAlignment="Center"
Text="{TemplateBinding PlaceholderText}"
Visibility="Collapsed">
VerticalAlignment="Center"
Visibility="Collapsed"
x:Name="PlaceholderTextBox">
<TextBlock.Foreground>
<SolidColorBrush Color="{DynamicResource TextPlaceholderColor}" />
</TextBlock.Foreground>
@@ -426,19 +411,19 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Text" Value="{x:Null}">
<Setter TargetName="PlaceholderTextBox" Property="Visibility" Value="Visible" />
<Setter Property="Visibility" TargetName="PlaceholderTextBox" Value="Visible" />
</Trigger>
<Trigger Property="Text" Value="">
<Setter TargetName="PlaceholderTextBox" Property="Visibility" Value="Visible" />
<Setter Property="Visibility" TargetName="PlaceholderTextBox" Value="Visible" />
</Trigger>
<Trigger Property="PlaceholderEnabled" Value="False">
<Setter TargetName="PlaceholderTextBox" Property="Visibility" Value="Collapsed" />
<Setter Property="Visibility" TargetName="PlaceholderTextBox" Value="Collapsed" />
</Trigger>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Cursor" Value="IBeam" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="PlaceholderTextBox" Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Foreground" TargetName="PlaceholderTextBox" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="ClearButtonEnabled" Value="False" />
</Trigger>