Skip to main content

TextAlignment Enum

Definition​

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

Defines how text is aligned.

public enum TextAlignment

Inheritance: Enum -> TextAlignment

Fields​

NameDescription
CenterThe text is centered.
DetectFromContentText alignment is inferred from the text content.
EndThe end of the text is aligned to the edge of the available space.
JustifyText is justified within the available space.
LeftThe text is left-aligned.
RightThe text is right-aligned.
StartThe beginning of the text is aligned to the edge of the available space.

Center Field​

The text is centered.

public Avalonia.Media.TextAlignment Center

DetectFromContent Field​

Text alignment is inferred from the text content.

public Avalonia.Media.TextAlignment DetectFromContent

Remarks​

When the TextAlignment property is set to DetectFromContent, alignment is inferred from the text content of the control. For example, English text is left aligned, and Arabic text is right aligned.

End Field​

The end of the text is aligned to the edge of the available space.

public Avalonia.Media.TextAlignment End

Justify Field​

Text is justified within the available space.

public Avalonia.Media.TextAlignment Justify

Left Field​

The text is left-aligned.

public Avalonia.Media.TextAlignment Left

Right Field​

The text is right-aligned.

public Avalonia.Media.TextAlignment Right

Start Field​

The beginning of the text is aligned to the edge of the available space.

public Avalonia.Media.TextAlignment Start