Skip to main content

UnderlineStyle Enum

Definition​

Assembly:Avalonia.Controls.Documents
Package:Avalonia.Controls.Documents

The line style of an underline. Qualifies an underline that Avalonia.Controls.Documents.TextModel.Formatting.TextDecorationFlags.Underline has already switched on; it never switches one on by itself, so a value here with no Avalonia.Controls.Documents.TextModel.Formatting.TextDecorationFlags.Underline flag draws nothing.

public enum UnderlineStyle

Inheritance: Enum -> UnderlineStyle

Remarks​

A null Avalonia.Controls.Documents.TextModel.Formatting.InlineFormatting.UnderlineStyle means unset and draws as Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle.Single. Null stays distinct from an explicit Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle.Single so that merging formatting down an inline chain keeps the child ?? parent idiom: an unset child takes the ancestor's style, while a child that says Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle.Single overrides it.

The values cover the underline variants RTF and DOCX can express, so a document that carries one survives an edit instead of degrading to a plain underline.

Fields​

NameDescription
DashDotAn alternating dash-dot line.
DashDotDotAn alternating dash-dot-dot line.
DashedA dashed line.
DottedA dotted line.
DoubleTwo parallel solid lines.
NoneNo underline style. Distinct from an unset (null) style: it records that the source explicitly said "no style", which is what RTF \ulnone and DOCX w:val="none" produce. Those also leave Avalonia.Controls.Documents.TextModel.Formatting.TextDecorationFlags.Underline off, so nothing draws.
SingleA single solid line.
ThickA single line of increased thickness.
WaveA wavy line. Approximated when drawn, because a text decoration is a straight stroke.
WordWords are underlined but the spaces between them are not. A scope rather than a line style, so it draws as Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle.Single.

DashDot Field​

An alternating dash-dot line.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle DashDot

DashDotDot Field​

An alternating dash-dot-dot line.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle DashDotDot

Dashed Field​

A dashed line.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle Dashed

Dotted Field​

A dotted line.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle Dotted

Double Field​

Two parallel solid lines.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle Double

None Field​

No underline style. Distinct from an unset (null) style: it records that the source explicitly said "no style", which is what RTF \ulnone and DOCX w:val="none" produce. Those also leave Avalonia.Controls.Documents.TextModel.Formatting.TextDecorationFlags.Underline off, so nothing draws.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle None

Single Field​

A single solid line.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle Single

Thick Field​

A single line of increased thickness.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle Thick

Wave Field​

A wavy line. Approximated when drawn, because a text decoration is a straight stroke.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle Wave

Word Field​

Words are underlined but the spaces between them are not. A scope rather than a line style, so it draws as Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle.Single.

public Avalonia.Controls.Documents.TextModel.Formatting.UnderlineStyle Word