RadioButton class Core

One choice of several, drawn as a ring with a dot and its caption beside it. In a RadioGroup it is one of the group's choices: picking it unpicks the others, the arrows walk the group and Tab stops only at the picked one. Alone it picks through RadioButton.Check and reads RadioButton.IsChecked, the way a check box toggles.

Picked on release-over (sliding off cancels) and on Space, through one endpoint; a focused screen-reader user hears the new state.

Styling. From the style sheets (Select.Type<RadioButton>()): the caption's colour, size, weight and family, a box behind the whole row (background, border, corner radius), the opacity, the colour of the ring and its dot (ArionStyle.AccentColor) and the focus ring, in every state - the picked one in TileStates.Checked (Select.Type<RadioButton>().Checked). The ring is the icon set's (ArionIcons.Radio).

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

Constructors

RadioButton

public RadioButton();

Properties

Check

public Action? Check { get; init; }

Picks this button, for a button outside a RadioGroup; in a group the group's RadioGroup.Select is called.

Checked

public bool Checked { get; }

Whether the button 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.

IsChecked

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

Whether this button is picked, for a button outside a RadioGroup; in a group the group answers.

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.