Skip to main content

Add Method

Adds an element with the provided key and value to the IDictionary(TKey, TValue).

Definition

Namespace: Avalonia.Collections
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public void Add(
TKey key,
TValue value
)

Parameters

  TKey
The object to use as the key of the element to add.
  TValue
The object to use as the value of the element to add.

Implements

IDictionary(TKey, TValue).Add(TKey, TValue)

Exceptions

ArgumentNullExceptionkey is null.
ArgumentExceptionAn element with the same key already exists in the IDictionary(TKey, TValue).
NotSupportedExceptionThe IDictionary(TKey, TValue) is read-only.

See Also

Reference

AvaloniaDictionary(TKey, TValue) Class
Avalonia.Collections Namespace