跳转至

IObservableDictionary<TKey, TValue>

  • 种类: interface
  • 命名空间: Runestone.AesirArchitecture
  • 程序集: Runestone.AesirArchitecture

实现接口: System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>,System.Collections.Generic.IDictionary<TKey, TValue>,Runestone.AesirArchitecture.IReadOnlyObservableDictionary<TKey, TValue>,System.Collections.Generic.IEnumerable<KeyValuePair<TKey, TValue>>,System.Collections.IEnumerable,Runestone.AesirArchitecture.IObservableCollection<KeyValuePair<TKey, TValue>>,System.Collections.Generic.ICollection<KeyValuePair<TKey, TValue>>,System.Collections.Generic.IReadOnlyCollection<KeyValuePair<TKey, TValue>>

类型参数

  • TKey — 键类型
  • TValue — 值类型

声明

[DefaultMember]
public interface IObservableDictionary<TKey, TValue> : System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>, 
System.Collections.Generic.IDictionary<TKey, TValue>, 
Runestone.AesirArchitecture.IReadOnlyObservableDictionary<TKey, TValue>, 
System.Collections.Generic.IEnumerable<KeyValuePair<TKey, TValue>>, 
System.Collections.IEnumerable, 
Runestone.AesirArchitecture.IObservableCollection<KeyValuePair<TKey, TValue>>, 
System.Collections.Generic.ICollection<KeyValuePair<TKey, TValue>>, 
System.Collections.Generic.IReadOnlyCollection<KeyValuePair<TKey, TValue>>  

完整可观察字典接口。 Model 层通过此接口读写集合;View 层使用 IReadOnlyObservableDictionary{TKey, TValue} 只读订阅。

备注

所有写操作完成后才触发对应事件,监听者回调中读取到的集合已是变更后的状态。 无变更的操作不触发事件:Remove 不存在的键、Clear 空字典、索引器赋相同值。

属性

名称 描述
Keys —
Values —
Item 读写指定键的值。重新声明以统一 IDictionary{TKey, TValue} 与 IReadOnlyDictionary{TKey, TValue} 的索引器。
Count —

Keys

public IEnumerable<TKey> Keys { get; }

Values

public IEnumerable<TValue> Values { get; }

Item

读写指定键的值。重新声明以统一 IDictionary{TKey, TValue} 与 IReadOnlyDictionary{TKey, TValue} 的索引器。

public TValue Item { get; set; }

Count

public int Count { get; }

方法

ContainsKey(TKey)

public abstract bool ContainsKey(TKey key)

参数

名称 类型 说明
key TKey —

返回值

类型 说明
bool —

TryGetValue(TKey, ref TValue)

public abstract bool TryGetValue(TKey key, out ref TValue value)

参数

名称 类型 说明
key TKey —
value ref TValue —

返回值

类型 说明
bool —

Additional Notes

首个 ## Additional Notes 是增量生成文档标识符,请勿修改标题级别和内容!本文档由 Script Doc Generator 辅助生成。