Label

A text label.
public class Label : Control

Properties

AutoShrink

How far the text may shrink to fit its width, 0.5 meaning half size, or 0 to truncate instead.

Type: double

public double AutoShrink { get; set; }

Bold

Shorthand for a bold FontWeight.

Type: Bindable<bool>

public Bindable<bool> Bold { get; set; }

FontDesign

The font's design: system, rounded, serif or monospaced.

Type: FontDesign

public FontDesign FontDesign { get; set; }

FontSize

Explicit font size in points, overriding TextStyle.

NaN falls back to the text style, or 17 points without one.

Type: Bindable<double>

public Bindable<double> FontSize { get; set; }

FontWeight

The font's weight.

Type: Bindable<FontWeight>

public Bindable<FontWeight> FontWeight { get; set; }

LetterSpacing

Extra points between characters (negative tightens).

Type: double

public double LetterSpacing { get; set; }

LineSpacing

Extra points between lines.

Type: double

public double LineSpacing { get; set; }

MaxFontSize

The largest point size Dynamic Type may scale the text to, or NaN to follow the accessibility sizes all the way up.

Type: double

public double MaxFontSize { get; set; }

MaxLines

Maximum number of lines, or 0 for unlimited (wraps freely).

Type: Bindable<int>

public Bindable<int> MaxLines { get; set; }

Spans

Styled runs composing the text, overriding Text when set.

Each run styles itself over the label's own font and color.

Type: IReadOnlyList<Span>?

public IReadOnlyList<Span>? Spans { get; set; }

Strikethrough

Strikes the text through.

Type: bool

public bool Strikethrough { get; set; }

Text

The text to display.

Type: Bindable<string?>

public Bindable<string?> Text { get; set; }

TextAlignment

Horizontal alignment of the text.

Type: Bindable<TextAlignment>

public Bindable<TextAlignment> TextAlignment { get; set; }

TextColor

Text color, or null for the system label color.

Type: Bindable<Color?>

public Bindable<Color?> TextColor { get; set; }

TextStyle

The step of the native type hierarchy the text follows, or null to size it by FontSize.

Type: TextStyle?

public TextStyle? TextStyle { get; set; }

Truncation

How the text is shortened when it does not fit.

Type: Truncation

public Truncation Truncation { get; set; }

Underline

Underlines the text.

Type: bool

public bool Underline { get; set; }