Skip to main content

AvaloniaDictionary<TKey, TValue> Class

Definition

Assembly:Avalonia.Base
Package:Avalonia

A notifying dictionary.

public class AvaloniaDictionary<TKey, TValue>

Inheritance: object -> AvaloniaDictionary<TKey, TValue>

Implements: IAvaloniaDictionary<,<T>>, IAvaloniaReadOnlyDictionary<,<T>>, ICollection<KeyValuePair<,<T>>>, IDictionary<,<T>>, IEnumerable<KeyValuePair<,<T>>>, IReadOnlyCollection<KeyValuePair<,<T>>>, IReadOnlyDictionary<,<T>>, ICollection, IDictionary, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged

Constructors

AvaloniaDictionary<TKey, TValue> overloads

AvaloniaDictionary<TKey, TValue> Constructor

Initializes a new instance of the Avalonia.Collections.AvaloniaDictionary<T1, T2> class.

public AvaloniaDictionary<TKey, TValue>()

AvaloniaDictionary<TKey, TValue> Constructor

public AvaloniaDictionary<TKey, TValue>(System.Collections.Generic.IDictionary<TKey, TValue> dictionary, System.Collections.Generic.IEqualityComparer<TKey> comparer)
Parameters

dictionary System.Collections.Generic.IDictionary<TKey, TValue>

comparer System.Collections.Generic.IEqualityComparer<TKey>

AvaloniaDictionary<TKey, TValue> Constructor

Initializes a new instance of the Avalonia.Collections.AvaloniaDictionary<T1, T2> class.

public AvaloniaDictionary<TKey, TValue>(int capacity)
Parameters

capacity int

Methods

NameDescription
AddNo summary available.
ClearNo summary available.
ContainsKeyNo summary available.
CopyToNo summary available.
GetEnumeratorNo summary available.
RemoveNo summary available.
TryGetValueNo summary available.

Add Method

public void Add(TKey key, TValue value)

Parameters

key TKey

value TValue

Clear Method

public void Clear()

ContainsKey Method

public bool ContainsKey(TKey key)

Parameters

key TKey

Returns

bool

CopyTo Method

public void CopyTo(System.Collections.Generic.KeyValuePair<TKey, TValue>[] array, int arrayIndex)

Parameters

array System.Collections.Generic.KeyValuePair<TKey, TValue>[]

arrayIndex int

GetEnumerator Method

public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey,TValue>> GetEnumerator()

Returns

System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey,TValue>>

Remove Method

public bool Remove(TKey key)

Parameters

key TKey

Returns

bool

TryGetValue Method

public bool TryGetValue(TKey key, TValue& value)

Parameters

key TKey

value TValue&

Returns

bool

Properties

NameDescription
CountNo summary available.
IsReadOnlyNo summary available.
ItemNo summary available.
KeysNo summary available.
ValuesNo summary available.

Count Property

public int Count { get; set; }

IsReadOnly Property

public bool IsReadOnly { get; set; }

Item Property

public TValue Item { get; set; }

Keys Property

public System.Collections.Generic.ICollection<TKey> Keys { get; set; }

Values Property

public System.Collections.Generic.ICollection<TValue> Values { get; set; }

Events

NameDescription
CollectionChangedOccurs when the collection changes.
PropertyChangedRaised when a property on the collection changes.

CollectionChanged Event

Occurs when the collection changes.

public event System.Collections.Specialized.NotifyCollectionChangedEventHandler CollectionChanged

PropertyChanged Event

Raised when a property on the collection changes.

public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged