fixed a bug of demo
This commit is contained in:
1 parent
8c7f34ad4a
commit
add2fd8237
6 files changed
+106
-6
No files matched your search
@@ -1,6 +1,7 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
@@ -127,4 +128,62 @@
|
||||
</DoubleAnimation>
|
||||
</Storyboard>
|
||||
|
||||
<Style x:Key="TextEditorCustom" TargetType="avalonedit:TextEditor">
|
||||
<Setter Property="IsReadOnly" Value="True"/>
|
||||
<Setter Property="FontFamily" Value="Consolas"/>
|
||||
<Setter Property="Margin" Value="4"/>
|
||||
<Setter Property="ShowLineNumbers" Value="True"/>
|
||||
<Setter Property="LineNumbersForeground" Value="{DynamicResource EditorLineNumbersForeground}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource EditorForeground}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="avalonedit:TextEditor">
|
||||
<ControlTemplate.Resources>
|
||||
<Style TargetType="avalonedit:TextView">
|
||||
<Setter Property="NonPrintableCharacterBrush" Value="{DynamicResource EditorNonPrintableCharacterBrush}" />
|
||||
<Setter Property="LinkTextForegroundBrush" Value="{DynamicResource EditorLinkTextForegroundBrush}" />
|
||||
<Setter Property="LinkTextBackgroundBrush" Value="{DynamicResource EditorLinkTextBackgroundBrush}" />
|
||||
</Style>
|
||||
<Style TargetType="avalonedit:TextArea">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<Setter Property="SelectionBrush" Value="{DynamicResource EditorSelectionBrush}" />
|
||||
<Setter Property="SelectionBorder">
|
||||
<Setter.Value>
|
||||
<Pen Brush="{DynamicResource EditorSelectionBorder}" Thickness="1" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="SelectionCornerRadius" Value="0" />
|
||||
<Setter Property="SelectionForeground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="avalonedit:TextArea">
|
||||
<DockPanel Focusable="False">
|
||||
<ItemsControl DockPanel.Dock="Left" Focusable="False" ItemsSource="{Binding LeftMargins,RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
<ContentPresenter Panel.ZIndex="-1" Content="{Binding TextView,RelativeSource={RelativeSource TemplatedParent}}" Focusable="False" />
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ControlTemplate.Resources>
|
||||
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<ScrollViewer Name="PART_ScrollViewer" Padding="{TemplateBinding Padding}" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" CanContentScroll="True" Content="{Binding TextArea,RelativeSource={RelativeSource TemplatedParent}}" Focusable="False" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="WordWrap" Value="True">
|
||||
<Setter TargetName="PART_ScrollViewer" Property="HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in new issue
Block a user