Edit

Share via


ObservableGroupedCollection<TKey,TValue> Class

Definition

An observable list of observable groups.

public sealed class ObservableGroupedCollection<TKey,TValue> : System.Collections.ObjectModel.ObservableCollection<CommunityToolkit.Common.Collections.ObservableGroup<TKey,TValue>>
type ObservableGroupedCollection<'Key, 'Value> = class
    inherit ObservableCollection<ObservableGroup<'Key, 'Value>>
Public NotInheritable Class ObservableGroupedCollection(Of TKey, TValue)
Inherits ObservableCollection(Of ObservableGroup(Of TKey, TValue))

Type Parameters

TKey

The type of the group key.

TValue

The type of the items in the collection.

Inheritance
ObservableGroupedCollection<TKey,TValue>

Constructors

ObservableGroupedCollection<TKey,TValue>()

Initializes a new instance of the ObservableGroupedCollection<TKey,TValue> class.

ObservableGroupedCollection<TKey,TValue>(IEnumerable<IGrouping<TKey,TValue>>)

Initializes a new instance of the ObservableGroupedCollection<TKey,TValue> class.

Extension Methods

AddGroup<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, TValue)

Adds a key-value ObservableGroup<TKey,TValue> item into a target ObservableGroupedCollection<TKey,TValue>.

AddGroup<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, TValue[])

Adds a key-collection ObservableGroup<TKey,TValue> item into a target ObservableGroupedCollection<TKey,TValue>.

AddGroup<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, IEnumerable<TValue>)

Adds a key-collection ObservableGroup<TKey,TValue> item into a target ObservableGroupedCollection<TKey,TValue>.

AddItem<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, TValue)

Add item into the first group with key key. If the group does not exist, it will be added.

ElementAt<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, Int32)

Return the element at position index from the first group with key key.

ElementAtOrDefault<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, Int32)

Return the element at position index from the first group with key key.

First<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey)

Return the first group with key key.

FirstOrDefault<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey)

Return the first group with key key or null if not found.

InsertItem<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, Int32, TValue)

Insert item into the first group with key key at index.

RemoveGroup<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey)

Remove the first occurrence of the group with key from the source grouped collection. It will not do anything if the group does not exist.

RemoveItem<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, TValue, Boolean)

Remove the first item from the first group with key from the source grouped collection. It will not do anything if the group or the item does not exist.

RemoveItemAt<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, Int32, Boolean)

Remove the item at index from the first group with key from the source grouped collection. It will not do anything if the group or the item does not exist.

SetItem<TKey,TValue>(ObservableGroupedCollection<TKey,TValue>, TKey, Int32, TValue)

Replace the element at index with item in the first group with key key.

Applies to