Table of Contents

Class LinearMultiSelector<T>

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

A linear range view that allows selection of zero or more options from a typed list.

public class LinearMultiSelector<T> : LinearRangeViewBase<T, IReadOnlyList<T>>, IDisposable, ISupportInitializeNotification, ISupportInitialize, IOrientation, IValue<IReadOnlyList<T>>, IValue, IDesignable

Type Parameters

T

The data type of the options.

Inheritance
LinearMultiSelector<T>
Implements
Derived
Inherited Members
Extension Methods

Remarks

Exposes the current selection through Value as IReadOnlyList<T>; the list is empty when no options are selected. A defensive copy is taken when Value is set, so the caller may mutate the list passed in without affecting subsequent reads.

Equality between the current value and a new value uses SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>), so two distinct list instances with the same elements in the same order are considered equal.

Constructors

LinearMultiSelector()

Initializes a new instance of LinearMultiSelector<T>.

LinearMultiSelector(List<T>?, Orientation)

Initializes a new instance of LinearMultiSelector<T>.

Properties

Value

Gets or sets the value.

Methods

EnableForDesign()

Loads demo data suitable for a designer preview: a multi-select LinearMultiSelector<T> of the seven days of the week, with the five weekdays (Mon–Fri) preselected. Only populated when T is string; for any other type, the view is left untouched and false is returned.

OnSelectionChanged()

Called by the base when the selected indices have changed due to user input. Concrete subclasses must compute their Value from the current selection and raise ValueChanged / ValueChangedUntyped.