Table of Contents

Class RadioButtons

Namespace
DrawnUi.Controls
Assembly
DrawnUi.Maui.dll

Manages radio button groups, ensuring only one button is selected per group. Supports grouping by parent control or by string name.

public class RadioButtons
Inheritance
RadioButtons
Inherited Members
Extension Methods

Constructors

RadioButtons()

Initializes a new instance of the RadioButtons class.

public RadioButtons()

Properties

All

Gets the singleton instance of the RadioButtons manager.

public static RadioButtons All { get; }

Property Value

RadioButtons

GroupsByName

protected Dictionary<string, List<ISkiaRadioButton>> GroupsByName { get; }

Property Value

Dictionary<string, List<ISkiaRadioButton>>

GroupsByParent

protected Dictionary<SkiaControl, List<ISkiaRadioButton>> GroupsByParent { get; }

Property Value

Dictionary<SkiaControl, List<ISkiaRadioButton>>

Methods

AddToGroup(ISkiaRadioButton, SkiaControl)

Adds a radio button control to a parent-based group. Ensures at least one button in the group is selected.

public void AddToGroup(ISkiaRadioButton control, SkiaControl parent)

Parameters

control ISkiaRadioButton

The radio button control to add to the group.

parent SkiaControl

The parent control that defines the group.

AddToGroup(ISkiaRadioButton, string)

Adds a radio button control to a named group. Ensures at least one button in the group is selected.

public void AddToGroup(ISkiaRadioButton control, string groupName)

Parameters

control ISkiaRadioButton

The radio button control to add to the group.

groupName string

The name of the group to add the control to.

GetSelected(SkiaControl)

Gets the currently selected radio button in the group associated with the specified parent control.

public SkiaControl GetSelected(SkiaControl parent)

Parameters

parent SkiaControl

The parent control that defines the radio button group.

Returns

SkiaControl

The selected SkiaControl, or null if no button is selected or group doesn't exist.

GetSelected(string)

Gets the currently selected radio button in the group with the specified name.

public SkiaControl GetSelected(string groupName)

Parameters

groupName string

The name of the radio button group.

Returns

SkiaControl

The selected SkiaControl, or null if no button is selected or group doesn't exist.

GetSelectedIndex(SkiaControl)

Gets the index of the currently selected radio button in the group associated with the specified parent control.

public int GetSelectedIndex(SkiaControl parent)

Parameters

parent SkiaControl

The parent control that defines the radio button group.

Returns

int

The zero-based index of the selected button, or -1 if no button is selected or group doesn't exist.

GetSelectedIndex(string)

Gets the index of the currently selected radio button in the group with the specified name.

public int GetSelectedIndex(string groupName)

Parameters

groupName string

The name of the radio button group.

Returns

int

The zero-based index of the selected button, or -1 if no button is selected or group doesn't exist.

RemoveFromGroup(SkiaControl, ISkiaRadioButton)

Removes a radio button control from a parent-based group. Ensures at least one button remains selected in the group.

public void RemoveFromGroup(SkiaControl parent, ISkiaRadioButton control)

Parameters

parent SkiaControl

The parent control that defines the group to remove the control from.

control ISkiaRadioButton

The radio button control to remove.

RemoveFromGroup(string, ISkiaRadioButton)

Removes a radio button control from a named group. Ensures at least one button remains selected in the group.

public void RemoveFromGroup(string groupName, ISkiaRadioButton control)

Parameters

groupName string

The name of the group to remove the control from.

control ISkiaRadioButton

The radio button control to remove.

RemoveFromGroups(ISkiaRadioButton)

Removes a radio button control from all groups it belongs to. Ensures at least one button remains selected in affected groups.

public void RemoveFromGroups(ISkiaRadioButton control)

Parameters

control ISkiaRadioButton

The radio button control to remove from all groups.

ReportValueChange(ISkiaRadioButton, bool)

Called by radio button controls to report value changes. Manages mutual exclusion within groups and fires the Changed event.

public void ReportValueChange(ISkiaRadioButton control, bool newValue)

Parameters

control ISkiaRadioButton

The radio button control reporting the change.

newValue bool

The new value of the control (true for selected, false for unselected).

Select(SkiaControl, int)

Selects the radio button at the specified index in the group associated with the container control.

public void Select(SkiaControl container, int index)

Parameters

container SkiaControl

The parent control that defines the radio button group.

index int

The zero-based index of the button to select.

Events

Changed

Occurs when a radio button selection changes in any group.

public event EventHandler Changed

Event Type

EventHandler