Class Label
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
FontStretch
Gets or sets the font stretch (e.g., condensed, semi-expanded etc.).
public FontStretch FontStretch { get; set; }
Property Value
FontStyle
Gets or sets the font style (e.g., normal, italic, oblique).
public FontStyle FontStyle { get; set; }
Property Value
FontWeight
Gets or sets the font weight (e.g., normal, bold, numeric weight).
public FontWeight FontWeight { get; set; }
Property Value
LineHeight
Gets or sets the line height of the text, in user units.
public NFloat LineHeight { get; set; }
Property Value
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
TextColor
Gets or sets the color used to fill the text.
public Color TextColor { get; set; }
Property Value
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
availableBorderEdgeSizeSizecontextIMeasureContext
Returns
RenderCore(IContext)
Draws this view's content and recurses into children.
protected override void RenderCore(IContext context)
Parameters
contextIContext