|
| 1 | +<!-- |
| 2 | + Based on Microsoft XAML for Win UI |
| 3 | + Copyright (c) Microsoft Corporation. All Rights Reserved. |
| 4 | +--> |
| 5 | + |
| 6 | +<ResourceDictionary |
| 7 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 8 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 9 | + xmlns:controls="clr-namespace:System.Windows;assembly=PresentationFramework"> |
| 10 | + |
| 11 | + <Style x:Key="DefaultRichTextBoxStyle" TargetType="{x:Type RichTextBox}"> |
| 12 | + <Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
| 13 | + <Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" /> |
| 14 | + <Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
| 15 | + <Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" /> |
| 16 | + <Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" /> |
| 17 | + <Setter Property="VerticalScrollBarVisibility" Value="Auto" /> |
| 18 | + <Setter Property="HorizontalScrollBarVisibility" Value="Disabled" /> |
| 19 | + <Setter Property="MinHeight" Value="34" /> |
| 20 | + <Setter Property="BorderThickness" Value="1" /> |
| 21 | + <Setter Property="Padding" Value="6,4" /> |
| 22 | + <Setter Property="FontSize" Value="14" /> |
| 23 | + <Setter Property="SnapsToDevicePixels" Value="True" /> |
| 24 | + <Setter Property="OverridesDefaultStyle" Value="True" /> |
| 25 | + <Setter Property="Template"> |
| 26 | + <Setter.Value> |
| 27 | + <ControlTemplate TargetType="{x:Type RichTextBox}"> |
| 28 | + <Border |
| 29 | + x:Name="MainBorder" |
| 30 | + Padding="0" |
| 31 | + Background="{TemplateBinding Background}" |
| 32 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 33 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 34 | + CornerRadius="4" |
| 35 | + Focusable="False"> |
| 36 | + <ScrollViewer |
| 37 | + x:Name="PART_ContentHost" |
| 38 | + Margin="0,0,2,0" |
| 39 | + Padding="{TemplateBinding Padding}" |
| 40 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 41 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 42 | + Foreground="{TemplateBinding Foreground}" |
| 43 | + HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}" |
| 44 | + VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}" /> |
| 45 | + </Border> |
| 46 | + <ControlTemplate.Triggers> |
| 47 | + <MultiTrigger> |
| 48 | + <MultiTrigger.Conditions> |
| 49 | + <Condition Property="IsEnabled" Value="True" /> |
| 50 | + <Condition Property="IsMouseOver" Value="True" /> |
| 51 | + <Condition Property="IsFocused" Value="False" /> |
| 52 | + </MultiTrigger.Conditions> |
| 53 | + <Setter Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" /> |
| 54 | + </MultiTrigger> |
| 55 | + <Trigger Property="IsFocused" Value="True"> |
| 56 | + <Setter Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" /> |
| 57 | + </Trigger> |
| 58 | + </ControlTemplate.Triggers> |
| 59 | + </ControlTemplate> |
| 60 | + </Setter.Value> |
| 61 | + </Setter> |
| 62 | + </Style> |
| 63 | + |
| 64 | + <Style |
| 65 | + x:Key="DefaultUiRichTextBoxStyle" |
| 66 | + BasedOn="{StaticResource DefaultRichTextBoxStyle}" |
| 67 | + TargetType="{x:Type RichTextBox}"> |
| 68 | + |
| 69 | + <Style.Triggers> |
| 70 | + <Trigger Property="TextBox.IsTextSelectionEnabled" Value="True"> |
| 71 | + <Setter Property="IsReadOnly" Value="False" /> |
| 72 | + <Setter Property="Background" Value="Transparent" /> |
| 73 | + <Setter Property="Padding" Value="0" /> |
| 74 | + <Setter Property="BorderBrush" Value="Transparent" /> |
| 75 | + <Setter Property="BorderThickness" Value="0" /> |
| 76 | + </Trigger> |
| 77 | + </Style.Triggers> |
| 78 | + </Style> |
| 79 | + |
| 80 | + <Style BasedOn="{StaticResource DefaultUiRichTextBoxStyle}" TargetType="{x:Type RichTextBox}" /> |
| 81 | + |
| 82 | + |
| 83 | +</ResourceDictionary> |
| 84 | + |
0 commit comments