Skip to content

How to customise style HorizontalRules

whistyun edited this page Dec 7, 2020 · 1 revision

Abstract

Horizontal Rules is rendered used by Markdown.Avalonia.Controls.Rule.

Example

style

<!--
    xmlns:mdctl="clr-namespace:Markdown.Avalonia.Controls;assembly=Markdown.Avalonia"
-->
<Style Selector="mdctl|Rule.Single">
    <Setter Property="Foreground" Value="Red"/>
</Style>

<Style Selector="mdctl|Rule.TwoLines">
    <Setter Property="SingleLineWidth" Value="2"/>
    <Setter Property="Foreground" Value="Green"/>
</Style>

<Style Selector="mdctl|Rule.Bold">
    <Setter Property="BoldLineWidth" Value="12"/>
    <Setter Property="Foreground" Value="Blue"/>
</Style>

<Style Selector="mdctl|Rule.BoldWithSingle">
    <Setter Property="SingleLineWidth" Value="2"/>
    <Setter Property="LineMargin" Value="6"/>
    <Setter Property="BoldLineWidth" Value="4"/>
</Style>

markdown

single line
 ---
two lines
 ===
bold line
***
bold with single
___

view

view

Support Styles

  • BoldLineWidth
  • Foreground
  • LineMargin
  • Margin
  • SingleLineWidth