Class NestedChangeTrackable
Base class for nested objects that support change tracking.
public abstract class NestedChangeTrackable : INotifyPropertyChanged
- Inheritance
-
objectNestedChangeTrackable
- Implements
Fields
ChangedProperties
Dictionary to track changes for properties within this nested object.
[JsonIgnore]
protected readonly Dictionary<string, object?> ChangedProperties
Field Value
- Dictionary<string, object>
Properties
HasChangesLocally
Indicates if any property within this nested object has changed.
[JsonIgnore]
public bool HasChangesLocally { get; }
Property Value
Methods
OnPropertyChanged(string?, object?)
Called when a property of this nested object changes. Updates local change tracking and notifies subscribers.
protected void OnPropertyChanged(string? propertyName = null, object? value = null)
Parameters
propertyNamestringThe name of the property.
valueobjectThe new value.
ResetChanges()
Resets the local change tracking for this nested object.
public void ResetChanges()
UpdateNestedChangeTrackable<T>(ref T, T, string)
Updates a nested change trackable object and subscribes to its property changes.
protected void UpdateNestedChangeTrackable<T>(ref T obj, T value, string name)
Parameters
objTvalueTnamestring
Type Parameters
T
Events
PropertyChanged
Event that is raised when a property of this nested object changes.
public event PropertyChangedEventHandler? PropertyChanged