TypeBadge class Core

A small rounded tag with a glyph ("Abc", "#", "Σ", "123") or an icon - what kind of field a row holds, or a status beside it. Takes no input and lets the pointer through to the control around it; read by assistive technology as text.

Styling. From the style sheets (Select.Type<TypeBadge>()): background, border, corner radius, padding, and the text's colour, size, weight and family. The TypeBadge.Kind is a class (text, number, date, accent, success, warning, danger) that the theme colours with the type and status tokens (Tokens.TypeTextInk on Tokens.TypeTextTint, Tokens.GreenText on Tokens.GreenTint and so on). Without a class the badge is 24 by 20 for a list; the class pill makes it an inline pill as wide as its text, fully rounded, and the class tile an icon tile rounded by 8 (give it a TypeBadge.Size such as 32 by 32 and an TypeBadge.IconSize) - the mark in front of a pane's title.

public sealed class TypeBadge : Control
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease
Inherits
Control

Constructors

TypeBadge

public TypeBadge();

Properties

Glyph

public Func<string>? Glyph { get; init; }

The glyph or short text shown; null when the badge shows an TypeBadge.Icon.

Icon

public Action<IRenderSurface, LogRect, Rgba>? Icon { get; init; }

An icon drawn centred in the text's colour instead of a glyph.

IconSize

public double IconSize { get; init; }

The size of the TypeBadge.Icon's box.

Kind

public TypeBadgeKind Kind { get; init; }

What kind of value the badge marks - its colours.

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.

Size

public LogSize Size { get; init; }

The size of a badge that is no pill.

Spoken

public Func<string>? Spoken { get; init; }

What a reader says for the badge ("Number field"); default: the glyph.

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.