57 lines
3.1 KiB
Plaintext
57 lines
3.1 KiB
Plaintext
|
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||
|
|
<ResourceDictionary.MergedDictionaries>
|
||
|
|
<ResourceDictionary Source="/NeuWPF;component/Controls/TextBoxContextMenu.xaml"/>
|
||
|
|
</ResourceDictionary.MergedDictionaries>
|
||
|
|
|
||
|
|
<Style TargetType="{x:Type TextBox}" x:Key="FlattenTextBox">
|
||
|
|
<Setter Property="Background" Value="{DynamicResource Background.TextField}" />
|
||
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
||
|
|
<Setter Property="Foreground" Value="{DynamicResource Text.Main}" />
|
||
|
|
<Setter Property="BorderThickness" Value="0" />
|
||
|
|
<Setter Property="FontSize" Value="14" />
|
||
|
|
<Setter Property="Padding" Value="4,2" />
|
||
|
|
<Setter Property="Margin" Value="0" />
|
||
|
|
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
|
||
|
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||
|
|
<Setter Property="AllowDrop" Value="true" />
|
||
|
|
<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
|
||
|
|
Background="{TemplateBinding Background}"
|
||
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||
|
|
SnapsToDevicePixels="True"
|
||
|
|
x:Name="border">
|
||
|
|
<ScrollViewer
|
||
|
|
Focusable="false"
|
||
|
|
HorizontalScrollBarVisibility="Hidden"
|
||
|
|
VerticalScrollBarVisibility="Hidden"
|
||
|
|
x:Name="PART_ContentHost" />
|
||
|
|
</Border>
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<!-- TODO:禁用效果 -->
|
||
|
|
<Trigger Property="IsEnabled" Value="false">
|
||
|
|
<Setter Property="TextElement.Foreground" TargetName="PART_ContentHost" Value="{DynamicResource Text.Main.Disabled}" />
|
||
|
|
</Trigger>
|
||
|
|
|
||
|
|
<Trigger Property="IsMouseOver" Value="true">
|
||
|
|
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource PrimaryBrush}" />
|
||
|
|
</Trigger>
|
||
|
|
|
||
|
|
<Trigger Property="IsKeyboardFocused" Value="true">
|
||
|
|
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource Primary.Focused}" />
|
||
|
|
|
||
|
|
</Trigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
|
||
|
|
</ResourceDictionary>
|