ObservableGroupedCollectionExtensions.ElementAtOrDefault<TKey,TValue> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Return the element at position index
from the first group with key
key.
public static TValue? ElementAtOrDefault<TKey,TValue> (this CommunityToolkit.Common.Collections.ObservableGroupedCollection<TKey,TValue> source, TKey key, int index);
static member ElementAtOrDefault : CommunityToolkit.Common.Collections.ObservableGroupedCollection<'Key, 'Value> * 'Key * int -> 'Value
<Extension()>
Public Function ElementAtOrDefault(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
The source ObservableGroupedCollection<TKey,TValue> instance.
- key
- TKey
The key of the group to query.
- index
- Int32
The index of the item from the targeted group.
Returns
TValue
The element or default(TValue) if it does not exist.