ObservableGroupedCollectionExtensions.AddItem<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.
Add item
into the first group with key
key.
If the group does not exist, it will be added.
public static CommunityToolkit.Common.Collections.ObservableGroup<TKey,TValue> AddItem<TKey,TValue> (this CommunityToolkit.Common.Collections.ObservableGroupedCollection<TKey,TValue> source, TKey key, TValue item);
static member AddItem : CommunityToolkit.Common.Collections.ObservableGroupedCollection<'Key, 'Value> * 'Key * 'Value -> CommunityToolkit.Common.Collections.ObservableGroup<'Key, 'Value>
<Extension()>
Public Function AddItem(Of TKey, TValue) (source As ObservableGroupedCollection(Of TKey, TValue), key As TKey, 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
The source ObservableGroupedCollection<TKey,TValue> instance.
- key
- TKey
The key of the group where the item
should be added.
- item
- TValue
The item to add.
Returns
The instance of the ObservableGroup<TKey,TValue> which will receive the value. It will either be an existing group or a new group.