Span

A styled run of text inside a Label's Label.Spans.

Every unset visual property follows the label; a set one overrides it for this run alone.

public class Span

Constructors

Creates a span.

public Span(
  string text)
ParameterSummary
string textThe run's text.

Properties

Bold

Shorthand for a bold FontWeight.

Type: bool

public bool Bold { get; set; }

FontDesign

The run's font design, or null to follow the label.

Type: FontDesign?

public FontDesign? FontDesign { get; set; }

FontSize

The run's font size in points, or NaN to follow the label.

Type: double

public double FontSize { get; set; }

FontWeight

The run's font weight, or null to follow the label.

Type: FontWeight?

public FontWeight? FontWeight { get; set; }

Strikethrough

Strikes the run through.

Type: bool

public bool Strikethrough { get; set; }

Text

The run's text.

Type: string

public string Text { get; set; }

TextColor

The run's text color, or null to follow the label.

Type: Color?

public Color? TextColor { get; set; }

Underline

Underlines the run.

Type: bool

public bool Underline { get; set; }

Operators

Implicit Span(string)

Wraps a plain string as an unstyled span, so string literals sit beside styled runs in a list.

public static implicit operator Span(
  string text)
ParameterSummary
string textThe run's text.

Returns

  • Span: An unstyled span containing the text.