Label class Core
Static text (a counter, a caption, a paragraph) — drawn, never focusable, hit-transparent, read by a screen reader as text. One line unless Label.MaxLines allows more. Rules for the label itself (Select.Type<Label>(), its Control.Classes) set its colour and font over the text it inherits from its tile.
public sealed class Label : Control
- Namespace
- ArionUI.Presentation.Controls
- Package
- ArionUI.Presentation ·
dotnet add package ArionUI.Presentation --prerelease - Inherits
- Control
Constructors
Label
public Label();
Properties
LineHeight
public double LineHeight { get; init; }Distance between baselines of wrapped lines; 0 derives it from the font size.
MaxLines
public int MaxLines { get; init; }Lines the text may wrap to; the last one ends in an ellipsis when cut.
MeasureText
public Func<string, TextStyle, double>? MeasureText { get; init; }How wide a string is drawn. With it - or with the tree's ControlHost.MeasureText - the label measures its own size (the width of one line, the height of all wrapped lines); without either the slot decides.
Role
public override ControlRole Role { get; }What KIND of part this is for assistive technology — the automation peers translate it into their host's control type.
Spoken
public Func<string>? Spoken { get; init; }What a screen reader hears instead of Label.Text - for a label that carries context the eye takes from its surroundings. Null speaks the text.
Style
public Func<TextStyle>? Style { get; init; }How the text is drawn. Null (the default) takes the text style of the board tile around the label - its ArionStyle font properties - and outside a tile the theme's body text, with what rules for the label itself set over it.
Text
public required Func<string> Text { get; init; }
Methods
HitTest
public override Control? HitTest(LogPoint p);The control under an ABSOLUTE point, or null. Containers recurse; leaves answer for themselves. Same bounds the render pass used.
Measure
public override LogSize Measure(LogSize available);Desired size given the space available (layout containers sum this).
Render
public override void Render(IRenderSurface s, ControlFrame frame);
SpokenLabel
public override string? SpokenLabel();What a screen reader speaks when this control receives the focus. A control that cannot take the focus but answers here is READ: it becomes a text part.
