SyncDictionaryList<TKey, TValue> 类
- 程序集
- ClassIsland.Core.dll
可同步字典与列表的数据类型,用于将字典绑定到前端数据上。
public class SyncDictionaryList<TKey, TValue> : INotifyPropertyChanged where TKey : notnull
类型参数
TKeyTValue
- 继承
-
SyncDictionaryList<TKey, TValue>
- 实现
- 继承成员
构造函数
SyncDictionaryList(IDictionary<TKey, TValue>, Func<TKey>, KeyValuePair<TKey, TValue>?)
初始化一个 SyncDictionaryList<TKey, TValue> 对象。
public SyncDictionaryList(IDictionary<TKey, TValue> dictionary, Func<TKey> newKey, KeyValuePair<TKey, TValue>? defaultValue = null)
参数
dictionaryIDictionary<TKey, TValue>newKeyFunc<TKey>defaultValueKeyValuePair<TKey, TValue>?
属性
DefaultValue
要向列表中添加的默认值。此默认值不会同步回字典。
public KeyValuePair<TKey, TValue>? DefaultValue { get; }
属性值
- KeyValuePair<TKey, TValue>?
List
公开的用于进行绑定的列表。
public ObservableCollection<KeyValuePair<TKey, TValue>> List { get; }
属性值
- ObservableCollection<KeyValuePair<TKey, TValue>>
方法
OnPropertyChanged(string?)
protected virtual void OnPropertyChanged(string? propertyName = null)
参数
propertyNamestring
SetField<T>(ref T, T, string?)
protected bool SetField<T>(ref T field, T value, string? propertyName = null)
参数
fieldTvalueTpropertyNamestring
返回
类型参数
T
事件
PropertyChanged
Occurs when a property value changes.
public event PropertyChangedEventHandler? PropertyChanged