[Back to home](Home) | [Back to Reference](Reference) | [View raw text](GeneratedDocs/ISelectableCollectionSource(T).md) # ISelectableCollectionSource< T> `interface` ## Description Defines a generic interface for a collection where items within it can be selected. ## Diagram ```mermaid flowchart LR classDef interfaceStyle stroke-dasharray: 5 5; classDef abstractStyle stroke-width:4px subgraph SolidShineUi SolidShineUi.ISelectableCollectionSource_1[[ISelectableCollectionSource< T >]] class SolidShineUi.ISelectableCollectionSource_1 interfaceStyle; end ``` ## Members ### Properties #### Public properties | Type | Name | Methods | | --- | --- | --- | | `bool` | [`CanSelectMultiple`](#canselectmultiple)
Get or set if multiple items can be selected in this collection. | `get, set` | | `ReadOnlyCollection`<`T`> | [`SelectedItems`](#selecteditems)
Get a list of currently selected items. | `get` | ### Methods #### Public methods | Returns | Name | | --- | --- | | `void` | [`AddToSelection`](#addtoselection)(`T` item) | | `void` | [`ClearSelection`](#clearselection)()
Clear the list of selected items. No items will be selected. | | `void` | [`Deselect`](#deselect)(`T` item) | | `bool` | [`IsSelected`](#isselected)(`T` item) | | `void` | [`Select`](#select)(`T` item) | | `void` | [`SelectAll`](#selectall)()
Select all items in the collection. | | `void` | [`SelectRange`](#selectrange)(`IEnumerable`<`T`> items) | ## Details ### Summary Defines a generic interface for a collection where items within it can be selected. ### Generic types | Type | Description | Constraints | | --- | --- | --- | | `T` | The type of items in the collection. | | ### Methods #### AddToSelection ```csharp public void AddToSelection(T item) ``` ##### Arguments | Type | Name | Description | | --- | --- | --- | | `T` | item | | #### Select ```csharp public void Select(T item) ``` ##### Arguments | Type | Name | Description | | --- | --- | --- | | `T` | item | | #### Deselect ```csharp public void Deselect(T item) ``` ##### Arguments | Type | Name | Description | | --- | --- | --- | | `T` | item | | #### SelectAll ```csharp public void SelectAll() ``` ##### Summary Select all items in the collection. #### ClearSelection ```csharp public void ClearSelection() ``` ##### Summary Clear the list of selected items. No items will be selected. #### IsSelected ```csharp public bool IsSelected(T item) ``` ##### Arguments | Type | Name | Description | | --- | --- | --- | | `T` | item | | #### SelectRange ```csharp public void SelectRange(IEnumerable items) ``` ##### Arguments | Type | Name | Description | | --- | --- | --- | | `IEnumerable`<`T`> | items | | ### Properties #### SelectedItems ```csharp public ReadOnlyCollection SelectedItems { get; } ``` ##### Summary Get a list of currently selected items. #### CanSelectMultiple ```csharp public bool CanSelectMultiple { get; set; } ``` ##### Summary Get or set if multiple items can be selected in this collection. ##### Remarks Some implementers may not allow this value to be changed via a setter; if so, a NotSupportedException will be thrown. ### Events #### SelectionChanged ```csharp public event SelectionChangedEventHandler SelectionChanged ``` ##### Summary Raised when the selection is changed, including additions and removals. *Generated with* [*ModularDoc*](https://github.com/hailstorm75/ModularDoc)