Files
Shrlalgo.RvKits/WPFDark/StandardControls/TextBox.xaml
ShrlAlgo 4d35cadb56 更新
2025-07-11 09:20:23 +08:00

59 lines
3.5 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="clr-namespace:WPFDark">
<Style TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="{DynamicResource TextBoxBackgroundBrushKey}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderBrushKey}" />
<Setter Property="Foreground" Value="{DynamicResource TextBoxForegroundBrushKey}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Padding" Value="1" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
<Setter Property="SelectionBrush" Value="{DynamicResource AccentBrushKey}" />
<Setter Property="Height" Value="{x:Static wpf:Boxes.BasicOneLineHeight}" />
<Setter Property="SelectionOpacity" Value="0.5" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{x:Static wpf:Boxes.BasicCornerRadius}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ScrollViewer x:Name="PART_ContentHost"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="Transparent"
HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}"
VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ActiveBackgroundBrushKey}" />
<Setter Property="BorderBrush" Value="{DynamicResource ActiveBorderBrushKey}" />
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="Background" Value="{DynamicResource ActiveBackgroundBrushKey}" />
<Setter Property="BorderBrush" Value="{DynamicResource ActiveBorderBrushKey}" />
</Trigger>
<Trigger Property="IsReadOnly" Value="True">
<Setter Property="Foreground" Value="{DynamicResource InactiveForegroundBrushKey}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource InactiveBackgroundBrushKey}" />
<Setter Property="BorderBrush" Value="{DynamicResource InactiveBorderBrushKey}" />
<Setter Property="Foreground" Value="{DynamicResource InactiveForegroundBrushKey}" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>