Class ImmutableObject
Extends DisposableObject with immutable feature, event PropertyChanged and other features. Allows to implement immutable objects with properties that can not be changed.
public class ImmutableObject : DisposableObject, IBaseObjectWithId, IImmutableObject, IDisposableObject, IDisposable, IBaseObject, INotifyPropertyChanged
- Inheritance
-
ImmutableObject
- Implements
- Derived
Constructors
- ImmutableObject()
Initializes a new instance of the ImmutableObject class.
Properties
- Immutable
Gets or sets whether object is immutable (properties can not be changed).
- IsPropertyChangedSuspended
Gets whether PropertyChanged event is suspended.
- PropertyChangedAction
Gets or sets an action which is called when a property value changes.
Methods
- DoInsideSuspendedPropertyChanged(Action, bool)
Calls the specified action inside block with suspended PropertyChanged event.
- GetNewFieldValue<T>(T, T)
Gets new field value and calls RaisePropertyChanged(string?) method.
- OnPropertyChanged(string?)
Called when object property is changed.
- RaisePropertyChanged(string?)
Calls PropertyChanged event. If events are suspended with previous call to SuspendPropertyChanged(), does nothing.
- ResumePropertyChanged(bool)
Resumes PropertyChanged event and OnPropertyChanged(string?) method so they will be called when properties are changed.
- SetImmutable()
Marks the object as immutable.
- SetProperty<T>(ref T?, T?)
Sets field value and calls RaisePropertyChanged(string?) method.
- SetProperty<T>(ref T?, T?, string?, Action?)
Sets field value and calls RaisePropertyChanged(string?) method.
- SuspendPropertyChanged()
Suspends PropertyChanged event and OnPropertyChanged(string?) method so they will not be called when properties are changed.
Events
- PropertyChanged
Occurs when a property value changes.