SettingsStorage.CreateProperty(T, string?) method¶
Defined in
Type: SettingsStorage Namespace: Akavache.Settings.Core Assembly: Akavache.Settings.dll
Applies to
net11.0, net11.0-maccatalyst27.2, net11.0-android37.0, net11.0-windows10.0.19041, net11.0-macos27.2, net11.0-ios27.2, net10.0, net10.0-macos26.0, net10.0-android36.0, net10.0-maccatalyst26.0, net10.0-ios26.0, net10.0-windows10.0.19041, net48, net471, net47, net472, net481
Attributes: [RequiresUnreferencedCode("CreateProperty requires types to be preserved for serialization.")] [RequiresDynamicCode("CreateProperty requires types to be preserved for serialization.")]
protected SettingsPropertyHelper<T> CreateProperty<T>(T defaultValue, string? propertyName = null)
View source (opens in a new tab)
Summary: Creates a property facade backed by the live observable stream for propertyName. The returned SettingsPropertyHelper exposes a sync Value getter, a Set method, an observable surface, and INotifyPropertyChanged (opens in a new tab) notifications — letting derived settings classes publish plain C# properties whose type is SettingsPropertyHelper without giving up the observable-first backbone.
Type parameters
| Name | Description |
|---|---|
T | The property value type. |
Parameters
| Name | Type | Description |
|---|---|---|
defaultValue | T | The value emitted before any persisted value has been loaded from disk. |
propertyName = null | string? (opens in a new tab) | The property name. Caller-member-name is resolved automatically when the helper is constructed from a property initializer or a constructor. |
Returns: SettingsPropertyHelper