Class SwiftObservableProperty<TValue>
- Namespace
- SwiftCollections.Observable
- Assembly
- SwiftCollections.dll
Represents a property of type TValue that raises a PropertyChanged event when its value changes.
[MemoryPackable(GenerateType.Object)]
public class SwiftObservableProperty<TValue> : INotifyPropertyChanged, IMemoryPackable<SwiftObservableProperty<TValue>>, IMemoryPackFormatterRegister
Type Parameters
TValueThe type of the value being observed.
- Inheritance
-
SwiftObservableProperty<TValue>
- Implements
-
IMemoryPackable<SwiftObservableProperty<TValue>>IMemoryPackFormatterRegister
- Inherited Members
Remarks
MemoryPack GenerateType: Object
TValue _value
Constructors
SwiftObservableProperty()
Initializes a new instance of the SwiftObservableProperty<TValue> class with the default value of TValue.
[MemoryPackConstructor]
public SwiftObservableProperty()
SwiftObservableProperty(TValue)
Initializes a new instance of the SwiftObservableProperty<TValue> class with the specified initial value.
public SwiftObservableProperty(TValue value)
Parameters
valueTValueThe initial value of the property.
Properties
Value
Gets or sets the property's value. Raises the PropertyChanged event when the value changes.
[JsonIgnore]
[MemoryPackIgnore]
public TValue Value { get; set; }
Property Value
- TValue
Methods
OnPropertyChanged(string)
Raises the PropertyChanged event with the specified property name.
protected virtual void OnPropertyChanged(string propertyName = "")
Parameters
propertyNamestring
Events
PropertyChanged
Raised whenever the property's value changes.
public event PropertyChangedEventHandler? PropertyChanged