Edit

Share via


ObservableGroupedCollectionExtensions.SetItem<TKey,TValue> Method

Definition

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

public static CommunityToolkit.Common.Collections.ObservableGroup<TKey,TValue> SetItem<TKey,TValue> (this CommunityToolkit.Common.Collections.ObservableGroupedCollection<TKey,TValue> source, TKey key, int index, TValue item);
static member SetItem : CommunityToolkit.Common.Collections.ObservableGroupedCollection<'Key, 'Value> * 'Key * int * 'Value -> CommunityToolkit.Common.Collections.ObservableGroup<'Key, 'Value>
<Extension()>
Public Function SetItem(Of TKey, TValue) (source As ObservableGroupedCollection(Of TKey, TValue), key As TKey, index As Integer, item As TValue) As ObservableGroup(Of TKey, 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 where to replace the item.

index
Int32

The index where to insert item.

item
TValue

The item to add.

Returns

The instance of the ObservableGroup<TKey,TValue> which will receive the value.

Exceptions

The target group does not exist.

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

Applies to