AttachableSettingsObject 类
- 命名空间
- ClassIsland.Shared
- 程序集
- ClassIsland.Shared.dll
代表一个可附加设置的对象
public class AttachableSettingsObject : ObservableRecipient, INotifyPropertyChanged, INotifyPropertyChanging
- 继承
-
AttachableSettingsObject
- 实现
- Derived
- 继承成员
属性
AttachedObjects
已附加的设置。键是GUID。
public Dictionary<string, object?> AttachedObjects { get; set; }
属性值
方法
GetAttachedObject<T>(Guid)
获取指定的附加设置项。
public T? GetAttachedObject<T>(Guid id)
参数
id
Guid要获取的附加设置ID
返回
- T
获取到的附加设置。如果没有找到附加设置,则返回null。
类型参数
T
要获取的附加设置类型
GetAttachedObject<T>(Guid, T)
获取指定的附加设置项,如果获取失败则将给定的默认值写入附加设置项,并返回给定的默认值。
public T GetAttachedObject<T>(Guid id, T defaultValue)
参数
id
Guid要获取的附加设置ID
defaultValue
T获取失败时返回的默认值
返回
- T
获取的附加设置项或默认值
类型参数
T
要获取的附加设置类型
WriteAttachedObject<T>(Guid, T)
写入指定的附加设置。
public void WriteAttachedObject<T>(Guid id, T o)
参数
id
Guid要写入的附加设置ID
o
T要写入的附加设置对象
类型参数
T
要写入的附加设置类型