ChoiceGroup class Core
A set of ChoiceTiles of which one is picked - RadioGroup for tiles. The group owns the pick (ChoiceGroup.Selected, ChoiceGroup.Select); the arrows move the pick to the next tile that can be picked, skipping disabled ones and wrapping at the ends, and the focus goes with it; Home and End pick the first and the last tile that can be picked; Tab enters at the picked tile. For assistive technology it is a radio group holding its tiles.
Styling. From the style sheets (Select.Type<ChoiceGroup>()): a box behind the tiles (background, border, corner radius, shadow) and the padding around them; the theme draws none.
public sealed class ChoiceGroup : Control
- Namespace
- ArionUI.Presentation.Controls
- Package
- ArionUI.Presentation ·
dotnet add package ArionUI.Presentation --prerelease - Inherits
- Control
Constructors
ChoiceGroup
public ChoiceGroup();
Properties
Children
public override IEnumerable<Control> Children { get; }The controls inside this one, in tree order (visual order, tab order). A host keeps the tree it adopted: a control whose children change once it is adopted says so with Control.TreeChanged (on a shown board inside Board.Mutate), or its new children get no host and Tab, ticks and the wheel do not find them.
Columns
public int Columns { get; init; }Lays the tiles out in a grid of this many equal columns, row by row (a choice of six summaries in two columns); 0 or 1 keeps them in one line along ChoiceGroup.Horizontal. Left and Right walk the tiles in their order, Up and Down move a row up or down (staying at the top and the bottom row).
Count
public int Count { get; }How many tiles the group holds.
Gap
public double Gap { get; init; }Space between two tiles.
Horizontal
public bool Horizontal { get; init; }Lays the tiles out side by side (the default) instead of one under the other.
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.
Select
public required Action<int> Select { get; init; }Picks the tile at the index - a click, Space, an arrow or assistive technology.
Selected
public required Func<int> Selected { get; init; }The index of the picked tile; -1 for none.
Tiles
public IReadOnlyList<ChoiceTile> Tiles { get; }The group's tiles, in order.
Uniform
public bool Uniform { get; init; }Gives every tile the same share of the group's width (side by side) - a segmented control; false lets each take what it measures.
Methods
Add
public ChoiceGroup Add(ChoiceTile tile);Adds tile as the next choice; it is enabled only while the group is. On a shown board add inside Board.Mutate.
Arrange
public override void Arrange(LogRect bounds);
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);