Table of Contents

Class BindableBase

Namespace
DotNetQuery.Mvvm
Assembly
DotNetQuery.Mvvm.dll

A minimal INotifyPropertyChanged base class for view models. Deliberately not named ObservableObject to avoid ambiguity with MVVM toolkits that may coexist in consuming applications.

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

Methods

RaisePropertyChanged(string?)

Raises PropertyChanged for propertyName. Call on the UI thread — bindings expect notifications there.

protected void RaisePropertyChanged(string? propertyName = null)

Parameters

propertyName string

The property name; defaults to the calling member.

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

Sets field to value and raises PropertyChanged when the value changed according to Default.

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

Parameters

field T

The backing field.

value T

The new value.

propertyName string

The property name; defaults to the calling member.

Returns

bool

true when the value changed and a notification was raised.

Type Parameters

T

The property type.

Events

PropertyChanged

Occurs when a property value changes.

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler