Reputation: 23
I wanna implement an editor that requires drawing RuleLines(Muted lins?) per line like the ones in the image below.
I'm going to use RichTextBox
or AvalonEdit.
Can you help me creating this pattern? Thanks in advance..
Upvotes: -1
Views: 104
Reputation: 23
I've done it in AvalonEdit by myself. add RulerLines(just need drawline via DrawingContext) class when VisualLine or TextView Rendering. Image Done
Upvotes: 0
Reputation: 8985
In WPF RichTextBox
you can set border thickness for the Paragraph
style. It will look like on your screenshot.
<RichTextBox x:Name="richtextbox" >
<RichTextBox.Resources>
<Style TargetType="{x:Type Paragraph}">
<Setter Property="BorderThickness" Value="0,0,0,1"></Setter>
<Setter Property="BorderBrush" Value="#388FFA"></Setter>
<Setter Property="Margin" Value="3"/>
<Setter Property="Padding" Value="2"/>
</Style>
</RichTextBox.Resources>
</RichTextBox>
Upvotes: 0