AvaloniaDictionaryTKey, TValue Class

A notifying dictionary.

Definition

Namespace: Avalonia.Collections
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public class AvaloniaDictionary<TKey, TValue> : IAvaloniaDictionary<TKey, TValue>, 
	IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, 
	IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IAvaloniaReadOnlyDictionary<TKey, TValue>, 
	IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, 
	INotifyCollectionChanged, INotifyPropertyChanged, IDictionary, ICollection
Inheritance
Object    AvaloniaDictionaryTKey, TValue
Implements
IAvaloniaDictionaryTKey, TValue, IAvaloniaReadOnlyDictionaryTKey, TValue, ICollectionKeyValuePairTKey, TValue, IDictionaryTKey, TValue, IEnumerableKeyValuePairTKey, TValue, IReadOnlyCollectionKeyValuePairTKey, TValue, IReadOnlyDictionaryTKey, TValue, ICollection, IDictionary, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged

Type Parameters

TKey
The type of the dictionary key.
TValue
The type of the dictionary value.

Properties

CountGets the number of elements contained in the ICollectionT.
IsReadOnlyGets a value indicating whether the ICollectionT is read-only.
ItemTKey Gets or sets the named resource.
KeysGets an ICollectionT containing the keys of the IDictionaryTKey, TValue.
ValuesGets an ICollectionT containing the values in the IDictionaryTKey, TValue.

Methods

Add(TKey, TValue)Adds an element with the provided key and value to the IDictionaryTKey, TValue.
ClearRemoves all items from the ICollectionT.
ContainsKey(TKey)Determines whether the IDictionaryTKey, TValue contains an element with the specified key.
CopyTo(KeyValuePairTKey, TValue, Int32)Copies the elements of the ICollectionT to an Array, starting at a particular Array index.
Equals(Object)Determines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetEnumeratorReturns an enumerator that iterates through the collection.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Remove(TKey)Removes the element with the specified key from the IDictionaryTKey, TValue.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryGetValue(TKey, TValue)Gets the value associated with the specified key.

Events

CollectionChanged Occurs when the collection changes.
PropertyChanged Raised when a property on the collection changes.

Extension Methods

GetWeakCollectionChangedObservable Gets a weak observable for the CollectionChanged event.
(Defined by NotifyCollectionChangedExtensions)
WeakSubscribe(ActionNotifyCollectionChangedEventArgs) Subscribes to the CollectionChanged event using a weak subscription.
(Defined by NotifyCollectionChangedExtensions)
WeakSubscribe(NotifyCollectionChangedEventHandler) Subscribes to the CollectionChanged event using a weak subscription.
(Defined by NotifyCollectionChangedExtensions)

See Also