ChoiceTile class Core

One choice of several shown as a tile: a picture (or a glyph such as "123") and a caption. In a ChoiceGroup picking it unpicks the others, the arrows walk the group and Tab stops only at the picked tile - a radio button that looks like a card. Alone it picks through ChoiceTile.Check and reads ChoiceTile.IsChecked. A disabled tile cannot be picked by any means.

Styling. From the style sheets (Select.Type<ChoiceTile>()): background, border, corner radius, shadow, opacity, the caption's colour, size and family and the focus ring, in every state - the picked one in TileStates.Checked. The theme draws a card that takes the accent's border (1.5), tint and deep text when picked, and the zone fill with faint text when disabled. The picked caption is semibold; the picture is drawn in the caption's colour. The ChoiceTile.Layout is a class (stacked, inline).

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

Constructors

ChoiceTile

public ChoiceTile();

Properties

Check

public Action? Check { get; init; }

Picks this tile, for a tile outside a ChoiceGroup.

Checked

public bool Checked { get; }

Whether the tile is picked now.

DrawsOwnFocus

public override bool DrawsOwnFocus { get; }

The control shows its focus itself (accent border, hover row, ring parameter). False = the host draws the shared default ring around Control.Bounds.

Focusable

public override bool Focusable { get; }

Can this KIND of control hold the keyboard focus? Combined with the live probes in Control.CanTakeFocus.

Glyph

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

A glyph shown where the picture would be ("123", "Σ") when there is none.

GlyphColor

public Func<Rgba>? GlyphColor { get; init; }

The colour of the ChoiceTile.Glyph while the tile is enabled - a theme token such as a type colour (ArionTheme.TypeNumberInk); null draws it in the caption's colour.

Height

public double Height { get; init; }

The height the tile asks for; NaN (the default) takes 66 stacked and 40 inline.

IsChecked

public Func<bool>? IsChecked { get; init; }

Whether this tile is picked, for a tile outside a ChoiceGroup.

Layout

public ChoiceTileLayout Layout { get; init; }

Where the picture goes.

Picture

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

The picture, drawn in the caption's colour into a 40 by 28 box (stacked) or a box as tall as the tile at the start (inline); null for none.

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.

Text

public required Func<string> Text { get; init; }

The caption, asked each time it is drawn.

ToggleState

public override bool? ToggleState { get; }

The checked state of a toggle part; null when the part does not toggle.

Methods

Invoke

public override bool Invoke();

Act like a click on the part (a button fires, a checkbox flips, a menu row runs, a dropdown opens). False when the part has no action or is disabled.

Measure

public override LogSize Measure(LogSize available);

Desired size given the space available (layout containers sum this).

OnActivate

protected internal override void OnActivate();

A click: the pointer went down on this control and came up over it again. The host calls it after Control.OnPointerReleased - not after a drag, a cancelled gesture or a release elsewhere, and not while the control is disabled or hidden. The one place a control acts on a click.

OnKey

public override bool OnKey(ArionKey key, ArionModifiers mods);

Keys while focused. Return false to let the pane's fallback see the key.

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.