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
Font
Gets or sets the complete font used for text measurement and rendering.
public Font Font { get; set; }
Property Value
FontFamily
Gets or sets the font family used for rendering the text.
public string FontFamily { get; set; }
Property Value
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)
Override to compute the desired border-edge size.
protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)
Parameters
availableBorderEdgeSizeSizecontextIMeasureContext
Returns
RenderCore(IContext)
Override to render this view and its children.
protected override void RenderCore(IContext context)
Parameters
contextIContext