Table of Contents

Class RadioGroupBuilder<T>

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Fluent builder for RadioGroup<T> — the non-visual coordination object that owns the single-selection invariant for a set of RadioControl<T> instances.

public sealed class RadioGroupBuilder<T>

Type Parameters

T

The value type each radio in the group represents.

Inheritance
RadioGroupBuilder<T>
Inherited Members
Extension Methods

Methods

AllowDeselect(bool)

Allows clicking the already-selected radio to clear the selection. Only takes effect when Required(bool) is false (Required wins).

public RadioGroupBuilder<T> AllowDeselect(bool allow = true)

Parameters

allow bool

Whether to allow deselecting.

Returns

RadioGroupBuilder<T>

The builder for chaining.

Build()

Builds and returns a configured RadioGroup<T>.

public RadioGroup<T> Build()

Returns

RadioGroup<T>

OnSelectionChanged(Action<T?>)

Subscribes to the SelectionChanged event in Build().

public RadioGroupBuilder<T> OnSelectionChanged(Action<T?> handler)

Parameters

handler Action<T>

The action to invoke when the selection changes.

Returns

RadioGroupBuilder<T>

The builder for chaining.

Required(bool)

Prevents the group from returning to "none" once a value is selected.

public RadioGroupBuilder<T> Required(bool required = true)

Parameters

required bool

Whether selection is required.

Returns

RadioGroupBuilder<T>

The builder for chaining.

WithSelectedValue(T)

Sets the initial selected value of the group.

public RadioGroupBuilder<T> WithSelectedValue(T value)

Parameters

value T

The value to pre-select.

Returns

RadioGroupBuilder<T>

The builder for chaining.