AvaloniaDictionary<TKey, TValue> Class
A notifying dictionary.
Definition
Namespace: Avalonia.Collections
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
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
Public Class AvaloniaDictionary(Of TKey, TValue)
Implements IAvaloniaDictionary(Of TKey, TValue), IDictionary(Of TKey, TValue),
ICollection(Of KeyValuePair(Of TKey, TValue)), IEnumerable(Of KeyValuePair(Of TKey, TValue)),
IEnumerable, IAvaloniaReadOnlyDictionary(Of TKey, TValue), IReadOnlyDictionary(Of TKey, TValue),
IReadOnlyCollection(Of KeyValuePair(Of TKey, TValue)), INotifyCollectionChanged,
INotifyPropertyChanged, IDictionary, ICollection
type AvaloniaDictionary<'TKey, 'TValue> =
class
interface IAvaloniaDictionary<'TKey, 'TValue>
interface IDictionary<'TKey, 'TValue>
interface ICollection<KeyValuePair<'TKey, 'TValue>>
interface IEnumerable<KeyValuePair<'TKey, 'TValue>>
interface IEnumerable
interface IAvaloniaReadOnlyDictionary<'TKey, 'TValue>
interface IReadOnlyDictionary<'TKey, 'TValue>
interface IReadOnlyCollection<KeyValuePair<'TKey, 'TValue>>
interface INotifyCollectionChanged
interface INotifyPropertyChanged
interface IDictionary
interface ICollection
end
Inheritance | Object → AvaloniaDictionary(TKey, TValue) |
Implements | IAvaloniaDictionary(TKey, TValue), IAvaloniaReadOnlyDictionary(TKey, TValue), ICollection(KeyValuePair(TKey, TValue)), IDictionary(TKey, TValue), IEnumerable(KeyValuePair(TKey, TValue)), IReadOnlyCollection(KeyValuePair(TKey, TValue)), IReadOnlyDictionary(TKey, TValue), ICollection, IDictionary, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged |
Type Parameters
- The type of the dictionary key.
- The type of the dictionary value.
Constructors
AvaloniaDictionary(TKey, TValue)() | Initializes a new instance of the AvaloniaDictionary(TKey, TValue) class. |
AvaloniaDictionary(TKey, TValue)(Int32) | Initializes a new instance of the AvaloniaDictionary(TKey, TValue) class. |
Properties
Count | Gets the number of elements contained in the ICollection(T). |
IsReadOnly | Gets a value indicating whether the ICollection(T) is read-only. |
Item(TKey) | Gets or sets the named resource. |
Keys | Gets an ICollection(T) containing the keys of the IDictionary(TKey, TValue). |
Values | Gets an ICollection(T) containing the values in the IDictionary(TKey, TValue). |
Methods
Add(TKey, TValue) | Adds an element with the provided key and value to the IDictionary(TKey, TValue). |
Clear() | Removes all items from the ICollection(T). |
ContainsKey(TKey) | Determines whether the IDictionary(TKey, TValue) contains an element with the specified key. |
CopyTo(KeyValuePair(TKey, TValue)[], Int32) | Copies the elements of the ICollection(T) 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) |
Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
GetEnumerator() | Returns an enumerator that iterates through the collection. |
GetHashCode() | Serves as the default hash function. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object) |
Remove(TKey) | Removes the element with the specified key from the IDictionary(TKey, TValue). |
ToString() | Returns 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(Action(NotifyCollectionChangedEventArgs)) | 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) |