wpfxamlrichtextboxavalonedit

How to implement RichTextBox or Avalonedit with RuleLine (muted lines) in WPF


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..

enter image description here


Solution

  • 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>
    

    enter image description here