Docs / UI

Glossary: LabelStyle

The members of LabelStyle, in alphabetical order.

Color legend plain property dependency property method

The style class of Label: the properties a style can set on it. None. Framework defaults: Text empty, FontSize DefaultFontSize, ForegroundColor DefaultTextColor, HitTest off, InheritState.FromParent.

A class deriving from BaseStyle. The styles page shows it in context.

Names are colored by what they are: a property, a method or an event; values and fields keep the plain color.

Properties

FontPath 🠆

string · The path of a TTF or OTF file to draw with (see Fonts). A path that loads replaces the font system in use; an empty or unreadable path goes back to the general font, but keeps a font system you set by hand.

FontSize 🠆

float · The font size in units. Negative values become 0, and 0 draws nothing. Default DefaultSettings.DefaultFontSize (14).

LineSpacing 🠆

int · Extra space between two lines, in units. Negative values become 0.

Text 🠆

string · The text shown. Line breaks start new lines, tabs become spaces. Default "".

TextAlignment 🠆

TextAlignment · How each line is placed across the width. Default Left.

TextMargin 🠆

Margin · The space between the label’s edges and its text, in units. It turns with TextRotation.

TextRotation 🠆

TextRotation · Turns the text and its frame by a quarter or a half turn. Default None.

VerticalTextAlignment 🠆

VerticalTextAlignment · Where the lines sit in a label taller than its text. Default Top.

WrapType 🠆

TextWrap · Whether lines break at spaces to fit the width. Applies only with a fixed or stretched width or a MaxWidth. Default NoWrap.

Methods

LabelStyle()

LabelStyle()

IsSet() 🠆

IsSet(string propertyName) · Whether the property is assigned to this style, so the style applies it. Pass the name with nameof; an unknown name gives false.

Parameter Type Description
propertyName string The name of a property of the style; nameof keeps it right.