80 lines
4.2 KiB
XML
80 lines
4.2 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:controls="clr-namespace:WPFluent.Controls"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<Style TargetType="{x:Type RichTextBox}" x:Key="DefaultRichTextBoxStyle">
|
|
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
|
<Setter Property="CaretBrush" Value="{DynamicResource TextFillColorPrimaryBrush}" />
|
|
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
|
|
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
|
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
|
|
<Setter Property="MinHeight" Value="34" />
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
<Setter Property="Padding" Value="6,4" />
|
|
<Setter Property="FontSize" Value="14" />
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type RichTextBox}">
|
|
<Border
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="4"
|
|
Focusable="False"
|
|
Padding="0"
|
|
x:Name="MainBorder">
|
|
<controls:PassiveScrollViewer
|
|
Foreground="{TemplateBinding Foreground}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}"
|
|
Margin="0,0,2,0"
|
|
Padding="{TemplateBinding Padding}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}"
|
|
x:Name="PART_ContentHost" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsEnabled" Value="True" />
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
<Condition Property="IsFocused" Value="False" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
|
|
</MultiTrigger>
|
|
<Trigger Property="IsFocused" Value="True">
|
|
<Setter Property="Background" Value="{DynamicResource ControlFillColorInputActiveBrush}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style BasedOn="{StaticResource DefaultRichTextBoxStyle}" TargetType="{x:Type RichTextBox}" />
|
|
|
|
<Style
|
|
BasedOn="{StaticResource DefaultRichTextBoxStyle}"
|
|
TargetType="{x:Type controls:RichTextBox}"
|
|
x:Key="DefaultUiRichTextBoxStyle">
|
|
|
|
<Style.Triggers>
|
|
<Trigger Property="IsTextSelectionEnabled" Value="True">
|
|
<Setter Property="IsReadOnly" Value="True" />
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Padding" Value="0" />
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style BasedOn="{StaticResource DefaultUiRichTextBoxStyle}" TargetType="{x:Type controls:RichTextBox}" />
|
|
|
|
</ResourceDictionary>
|