Table of Contents

Class NestedChangeTrackable

Namespace
BpNexT.NET.Models.Internal
Assembly
BpNexT.NET.dll

Base class for nested objects that support change tracking.

public abstract class NestedChangeTrackable : INotifyPropertyChanged
Inheritance
object
NestedChangeTrackable
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

bool

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

propertyName string

The name of the property.

value object

The 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

obj T
value T
name string

Type Parameters

T

Events

PropertyChanged

Event that is raised when a property of this nested object changes.

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler