Table of Contents

Class Label

Namespace
Xui.Core.UI
Assembly
Xui.Core.dll

A view that displays a single line of styled text.

public class Label : View, ILayerHost, IServiceProvider
Inheritance
Label
Implements
Inherited Members
Extension Methods

Properties

FontFamily

Gets or sets the font family used for rendering the text.

public string[] FontFamily { get; set; }

Property Value

string[]

FontSize

Gets or sets the font size in points.

public NFloat FontSize { get; set; }

Property Value

NFloat

FontStretch

Gets or sets the font stretch (e.g., condensed, semi-expanded etc.).

public FontStretch FontStretch { get; set; }

Property Value

FontStretch

FontStyle

Gets or sets the font style (e.g., normal, italic, oblique).

public FontStyle FontStyle { get; set; }

Property Value

FontStyle

FontWeight

Gets or sets the font weight (e.g., normal, bold, numeric weight).

public FontWeight FontWeight { get; set; }

Property Value

FontWeight

LineHeight

Gets or sets the line height of the text, in user units.

public NFloat LineHeight { get; set; }

Property Value

NFloat

Remarks

If set to a numeric value, this value overrides the default line height computation from the font metrics. If set to NaN, the line height will be automatically computed based on the font's ascender, descender, and line gap, or fallback to a platform-specific multiplier of the FontSize (typically 1.2×).

Text

Gets or sets the text content displayed by the label.

public string Text { get; set; }

Property Value

string

TextColor

Gets or sets the color used to fill the text.

public Color TextColor { get; set; }

Property Value

Color

Methods

MeasureCore(Size, IMeasureContext)

Returns the desired border-edge size given the available border-edge space. Margin, min/max clamping, and fixed-size short-circuit are handled by MeasureShell(ref LayoutGuide).

protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)

Parameters

availableBorderEdgeSize Size
context IMeasureContext

Returns

Size

RenderCore(IContext)

Draws this view's content and recurses into children.

protected override void RenderCore(IContext context)

Parameters

context IContext