Table of Contents

Class ObservableBase

Namespace
FlowGraph.Core.Models
Assembly
FlowGraph.Core.dll

Minimal base class for observable objects using pure .NET INotifyPropertyChanged. This class provides framework-agnostic property change notification without external dependencies like CommunityToolkit.Mvvm.

public abstract class ObservableBase : INotifyPropertyChanged
Inheritance
ObservableBase
Implements
Derived
Inherited Members

Methods

OnPropertyChanged(string?)

Raises the PropertyChanged event.

protected virtual void OnPropertyChanged(string? propertyName = null)

Parameters

propertyName string

The name of the property that changed.

SetField<T>(ref T, T, Action, string?)

Sets a property value, raises PropertyChanged, and invokes a callback if the value changed.

protected bool SetField<T>(ref T field, T value, Action onChanged, string? propertyName = null)

Parameters

field T

Reference to the backing field.

value T

The new value.

onChanged Action

Callback to invoke after the property changes.

propertyName string

The property name (auto-populated by compiler).

Returns

bool

True if the value changed; otherwise false.

Type Parameters

T

The type of the property.

SetField<T>(ref T, T, Action<T, T>, string?)

Sets a property value, raises PropertyChanged, and invokes a callback with old/new values if the value changed.

protected bool SetField<T>(ref T field, T value, Action<T, T> onChanged, string? propertyName = null)

Parameters

field T

Reference to the backing field.

value T

The new value.

onChanged Action<T, T>

Callback to invoke with old and new values after the property changes.

propertyName string

The property name (auto-populated by compiler).

Returns

bool

True if the value changed; otherwise false.

Type Parameters

T

The type of the property.

SetField<T>(ref T, T, string?)

Sets a property value and raises PropertyChanged if the value changed.

protected bool SetField<T>(ref T field, T value, string? propertyName = null)

Parameters

field T

Reference to the backing field.

value T

The new value.

propertyName string

The property name (auto-populated by compiler).

Returns

bool

True if the value changed; otherwise false.

Type Parameters

T

The type of the property.

Events

PropertyChanged

Occurs when a property value changes.

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler