ObservableDictionary<TKey, TValue> 类
- 命名空间
- ClassIsland.Shared
- 程序集
- ClassIsland.Shared.dll
public class ObservableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable, INotifyCollectionChanged, INotifyPropertyChanged
类型参数
TKey
TValue
- 继承
-
Dictionary<TKey, TValue>ObservableDictionary<TKey, TValue>
- 实现
-
IDictionary<TKey, TValue>ICollection<KeyValuePair<TKey, TValue>>IReadOnlyDictionary<TKey, TValue>IReadOnlyCollection<KeyValuePair<TKey, TValue>>IEnumerable<KeyValuePair<TKey, TValue>>
- 继承成员
- 扩展方法
构造函数
ObservableDictionary()
public ObservableDictionary()
属性
Count
public int Count { get; }
属性值
this[int]
public TValue this[int index] { get; set; }
参数
index
int
属性值
- TValue
this[TKey]
public TValue this[TKey key] { get; set; }
参数
key
TKey
属性值
- TValue
Keys
public Dictionary<TKey, TValue>.KeyCollection Keys { get; }
属性值
- Dictionary<TKey, TValue>.KeyCollection
Values
public Dictionary<TKey, TValue>.ValueCollection Values { get; }
属性值
- Dictionary<TKey, TValue>.ValueCollection
方法
Add(TKey, TValue)
public void Add(TKey key, TValue value)
参数
key
TKeyvalue
TValue
Clear()
public void Clear()
OnCollectionChanged(NotifyCollectionChangedEventArgs)
protected void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
参数
OnPropertyChanged(string)
protected void OnPropertyChanged(string propertyName)
参数
propertyName
string
Remove(TKey)
public bool Remove(TKey key)
参数
key
TKey
返回
事件
CollectionChanged
Occurs when the collection changes.
public event NotifyCollectionChangedEventHandler CollectionChanged
事件类型
PropertyChanged
Occurs when a property value changes.
public event PropertyChangedEventHandler PropertyChanged