Edit

Share via


ObservableGroupedCollectionExtensions.ElementAt<TKey,TValue> Method

Definition

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

public static TValue ElementAt<TKey,TValue> (this CommunityToolkit.Common.Collections.ObservableGroupedCollection<TKey,TValue> source, TKey key, int index);
static member ElementAt : CommunityToolkit.Common.Collections.ObservableGroupedCollection<'Key, 'Value> * 'Key * int -> 'Value
<Extension()>
Public Function ElementAt(Of TKey, TValue) (source As ObservableGroupedCollection(Of TKey, TValue), key As TKey, index As Integer) As TValue

Type Parameters

TKey

The type of the group key.

TValue

The type of the items in the collection.

Parameters

key
TKey

The key of the group to query.

index
Int32

The index of the item from the targeted group.

Returns

TValue

The element.

Exceptions

The target group does not exist.

index is less than zero or index is greater than the group elements' count.

Applies to