Show / Hide Table of Contents

Class ObservableDictionary<TKey, TValue>

http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/

Inheritance
Object
ObservableDictionary<TKey, TValue>
Implements
IDictionary<TKey, TValue>
ICollection<KeyValuePair<TKey, TValue>>
IEnumerable<KeyValuePair<TKey, TValue>>
IDictionary
ICollection
IEnumerable
INotifyPropertyChanged
INotifyCollectionChanged
ISerializable
IDeserializationCallback
Namespace: Ecng.Xaml
Assembly: StockSharp.Xaml.dll
Syntax
public class ObservableDictionary<TKey, TValue> : Object, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, INotifyPropertyChanged, INotifyCollectionChanged, ISerializable, IDeserializationCallback
Type Parameters
Name Description
TKey
TValue

Constructors

ObservableDictionary()

Declaration
public ObservableDictionary()

ObservableDictionary(IDictionary<TKey, TValue>)

Declaration
public ObservableDictionary(IDictionary<TKey, TValue> dictionary)
Parameters
Type Name Description
IDictionary<TKey, TValue> dictionary

ObservableDictionary(IDictionary<TKey, TValue>, IEqualityComparer<TKey>)

Declaration
public ObservableDictionary(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer)
Parameters
Type Name Description
IDictionary<TKey, TValue> dictionary
IEqualityComparer<TKey> comparer

ObservableDictionary(IEqualityComparer<TKey>)

Declaration
public ObservableDictionary(IEqualityComparer<TKey> comparer)
Parameters
Type Name Description
IEqualityComparer<TKey> comparer

ObservableDictionary(SerializationInfo, StreamingContext)

Declaration
protected ObservableDictionary(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
SerializationInfo info
StreamingContext context

Properties

Comparer

Declaration
public IEqualityComparer<TKey> Comparer { get; }
Property Value
Type Description
IEqualityComparer<TKey>

Count

Declaration
public int Count { get; }
Property Value
Type Description
Int32

Item[TKey]

Declaration
public TValue this[TKey key] { get; set; }
Parameters
Type Name Description
TKey key
Property Value
Type Description
TValue

Keys

Declaration
public Dictionary<TKey, TValue>.KeyCollection Keys { get; }
Property Value
Type Description
Dictionary.KeyCollection<>

Values

Declaration
public Dictionary<TKey, TValue>.ValueCollection Values { get; }
Property Value
Type Description
Dictionary.ValueCollection<>

Methods

Add(TKey, TValue)

Declaration
public void Add(TKey key, TValue value)
Parameters
Type Name Description
TKey key
TValue value

AddEntry(TKey, TValue)

Declaration
protected virtual bool AddEntry(TKey key, TValue value)
Parameters
Type Name Description
TKey key
TValue value
Returns
Type Description
Boolean

Clear()

Declaration
public void Clear()

ClearEntries()

Declaration
protected virtual bool ClearEntries()
Returns
Type Description
Boolean

ContainsKey(TKey)

Declaration
public bool ContainsKey(TKey key)
Parameters
Type Name Description
TKey key
Returns
Type Description
Boolean

ContainsValue(TValue)

Declaration
public bool ContainsValue(TValue value)
Parameters
Type Name Description
TValue value
Returns
Type Description
Boolean

GetEnumerator()

Declaration
public IEnumerator GetEnumerator()
Returns
Type Description
IEnumerator

GetIndexAndEntryForKey(TKey, out DictionaryEntry)

Declaration
protected int GetIndexAndEntryForKey(TKey key, out DictionaryEntry entry)
Parameters
Type Name Description
TKey key
DictionaryEntry entry
Returns
Type Description
Int32

GetObjectData(SerializationInfo, StreamingContext)

Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
SerializationInfo info
StreamingContext context

OnCollectionChanged(NotifyCollectionChangedEventArgs)

Declaration
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
Type Name Description
NotifyCollectionChangedEventArgs args

OnDeserialization(Object)

Declaration
public virtual void OnDeserialization(object sender)
Parameters
Type Name Description
Object sender

OnPropertyChanged(String)

Declaration
protected virtual void OnPropertyChanged(string name)
Parameters
Type Name Description
String name

Remove(TKey)

Declaration
public bool Remove(TKey key)
Parameters
Type Name Description
TKey key
Returns
Type Description
Boolean

RemoveEntry(TKey)

Declaration
protected virtual bool RemoveEntry(TKey key)
Parameters
Type Name Description
TKey key
Returns
Type Description
Boolean

SetEntry(TKey, TValue)

Declaration
protected virtual bool SetEntry(TKey key, TValue value)
Parameters
Type Name Description
TKey key
TValue value
Returns
Type Description
Boolean

TryGetValue(TKey, out TValue)

Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
Type Name Description
TKey key
TValue value
Returns
Type Description
Boolean

Events

CollectionChanged

Declaration
protected virtual event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
Type Description
NotifyCollectionChangedEventHandler

PropertyChanged

Declaration
protected virtual event PropertyChangedEventHandler PropertyChanged
Event Type
Type Description
PropertyChangedEventHandler

Implements

System.Collections.Generic.IDictionary<TKey,TValue>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IDictionary
System.Collections.ICollection
System.Collections.IEnumerable
System.ComponentModel.INotifyPropertyChanged
System.Collections.Specialized.INotifyCollectionChanged
System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback

Extension Methods

Paths.Serialize<T>(T, String)
Paths.Serialize<T>(T)
Extensions.TryGet<TMessage, TChange>(TMessage, TChange)
Extensions.TryGetDecimal<TMessage, TChange>(TMessage, TChange)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Object)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Decimal)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Int32)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Int64)
Extensions.Add<TMessage, TChange>(TMessage, TChange, SecurityStates)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<SecurityStates>)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, String)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Sides)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Sides>)
Extensions.Add<TMessage, TChange>(TMessage, TChange, CurrencyTypes)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<CurrencyTypes>)
Extensions.Add<TMessage, TChange>(TMessage, TChange, PortfolioStates)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<PortfolioStates>)
Extensions.Add<TMessage, TChange>(TMessage, TChange, DateTimeOffset)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<DateTimeOffset>)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Boolean>)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Decimal, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Decimal>, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Int32, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Int32>, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Int64, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Int64>, Boolean)
EditorExtensions.ToItemsSource(Object, Type, Nullable<Boolean>, Nullable<ListSortDirection>, Func<IItemsSourceItem, Boolean>, Func<Object, String>, Func<Object, String>)
XamlHelper.WpfCast<T>(Object)
XamlHelper.CopyToClipboard<T>(T)
XamlHelper.EnsureUIThread(Object)
☀
☾
In This Article
Back to top
Copyright © StockSharp.
☀
☾