Files
ShrlAlgoToolkit/Melskin/Controls/FlattenTextBox.xaml

55 lines
3.1 KiB
Plaintext
Raw Normal View History

2025-07-31 20:12:24 +08:00
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
2026-01-02 17:30:41 +08:00
<ResourceDictionary Source="/Melskin;component/Controls/TextBoxContextMenu.xaml" />
2025-07-31 20:12:24 +08:00
</ResourceDictionary.MergedDictionaries>
2026-02-20 15:31:44 +08:00
<Style x:Key="FlattenTextBoxStyle" TargetType="{x:Type TextBox}">
2025-08-12 23:08:54 +08:00
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
2025-07-31 20:12:24 +08:00
<Setter Property="BorderBrush" Value="Transparent" />
2025-08-12 23:08:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
2025-07-31 20:12:24 +08:00
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="14" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
2025-09-12 09:55:36 +08:00
<Setter Property="AllowDrop" Value="True" />
2025-07-31 20:12:24 +08:00
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="ContextMenu" Value="{DynamicResource TextBoxContextMenu}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border
2026-02-20 15:31:44 +08:00
x:Name="border"
2025-07-31 20:12:24 +08:00
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
2026-02-20 15:31:44 +08:00
SnapsToDevicePixels="True">
2025-07-31 20:12:24 +08:00
<ScrollViewer
2026-02-20 15:31:44 +08:00
x:Name="PART_ContentHost"
2025-09-12 09:55:36 +08:00
Focusable="False"
2025-07-31 20:12:24 +08:00
HorizontalScrollBarVisibility="Hidden"
2026-02-20 15:31:44 +08:00
VerticalScrollBarVisibility="Hidden" />
2025-07-31 20:12:24 +08:00
</Border>
<ControlTemplate.Triggers>
2025-09-12 09:55:36 +08:00
<Trigger Property="IsEnabled" Value="False">
2026-02-20 15:31:44 +08:00
<Setter TargetName="PART_ContentHost" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
2025-10-10 11:19:58 +08:00
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
2025-12-23 21:35:54 +08:00
<Setter Property="Cursor" Value="None" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-09-12 09:55:36 +08:00
<Trigger Property="IsMouseOver" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
2025-09-12 09:55:36 +08:00
<Trigger Property="IsKeyboardFocused" Value="True">
2026-02-20 15:31:44 +08:00
<Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource PrimaryFocusedBrush}" />
2025-07-31 20:12:24 +08:00
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>