Skip to content

SelectableCollectionView(T)

JaykeBird edited this page Feb 21, 2023 · 9 revisions

Back to home | Back to Reference | View raw text

SelectableCollectionView<T> class

Description

A type of CollectionView that operates as a SelectableCollection. This can be used as a SelectPanel's ItemsSource if T derives from SelectableUserControl.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi
  SolidShineUi.SelectableCollectionView_1[[SelectableCollectionView< T >]]

  SolidShineUi.ISelectableCollectionSource_1[[ISelectableCollectionSource< T >]]
  class SolidShineUi.ISelectableCollectionSource_1 interfaceStyle;

  end
  subgraph System.Collections.Generic
System.Collections.Generic.IEnumerable_1[[IEnumerable]]
  end
  subgraph System.Collections
System.Collections.IEnumerable[[IEnumerable]]
  end
  subgraph System.Windows.Data
System.Windows.Data.ListCollectionView[[ListCollectionView]]
  end
SolidShineUi.ISelectableCollectionSource_1 --> SolidShineUi.SelectableCollectionView_1
System.Collections.Generic.IEnumerable_1 --> SolidShineUi.SelectableCollectionView_1
System.Collections.IEnumerable --> SolidShineUi.SelectableCollectionView_1
System.Windows.Data.ListCollectionView --> SolidShineUi.SelectableCollectionView_1
Loading

Members

Properties

Public properties

Type Name Methods
bool CanSelectMultiple
Get if multiple items can be selected at once. This property cannot be changed or set to; trying to call the setter will raise a NotSupportedException .
get, set
T Item get
ReadOnlyCollection<T> SelectedItems
Get a list of currently selected items.
get

Methods

Public methods

Returns Name
void AddToSelection(T item)
void ClearSelection()
Clear the list of selected items. Nothing will be selected.
bool Contains(T item)
void Deselect(T item)
int IndexOf(T item)
bool IsSelected(T item)
void Remove(T item)
void Select(T item)
void SelectAll()
Select all items in the base collection.
void SelectRange(IEnumerable<T> items)

Details

Summary

A type of CollectionView that operates as a SelectableCollection. This can be used as a SelectPanel's ItemsSource if T derives from SelectableUserControl.

Generic types

Type Description Constraints
T The type of items in the collection.

Inheritance

Constructors

SelectableCollectionView [1/2]

public SelectableCollectionView(List<T> collection)
Arguments
Type Name Description
List<T> collection

SelectableCollectionView [2/2]

public SelectableCollectionView(IList collection)
Arguments
Type Name Description
IList collection The collection that is represented in this view.
Summary

Create a SelectableCollectionView, that represents a view of the specified list.

Exceptions
Name Description
ArgumentException Thrown if collection is not a generic IList of type T ( IList<T> ).

Methods

AddToSelection

public virtual void AddToSelection(T item)
Arguments
Type Name Description
T item

Select

public virtual void Select(T item)
Arguments
Type Name Description
T item

Deselect

public virtual void Deselect(T item)
Arguments
Type Name Description
T item

SelectAll

public virtual void SelectAll()
Summary

Select all items in the base collection.

ClearSelection

public virtual void ClearSelection()
Summary

Clear the list of selected items. Nothing will be selected.

IsSelected

public virtual bool IsSelected(T item)
Arguments
Type Name Description
T item

SelectRange

public virtual void SelectRange(IEnumerable<T> items)
Arguments
Type Name Description
IEnumerable<T> items

IndexOf

public int IndexOf(T item)
Arguments
Type Name Description
T item

Contains

public bool Contains(T item)
Arguments
Type Name Description
T item

Remove

public void Remove(T item)
Arguments
Type Name Description
T item

Properties

SelectedItems

public virtual ReadOnlyCollection<T> SelectedItems { get; }
Summary

Get a list of currently selected items.

CanSelectMultiple

public virtual bool CanSelectMultiple { get; set; }
Summary

Get if multiple items can be selected at once. This property cannot be changed or set to; trying to call the setter will raise a NotSupportedException .

Exceptions
Name Description
NotSupportedException Raised if the setter for this property is called. This property is implemented as read-only here.

Item

public T Item { get; }

Events

SelectionChanged

public event SelectionChangedEventHandler SelectionChanged
Summary

Raised when the list of selected items is changed.

Generated with ModularDoc

Clone this wiki locally