Class
NotifyPropertyChangedBase

Base class that provides property change notification mechanism. Implements INotifyPropertyChanged interface.

Definition

Constructors

NotifyPropertyChangedBase()

Declaration

cs-api-definition
protected NotifyPropertyChangedBase()

Methods

OnPropertyChanged(string)

Raises the PropertyChanged event.

Declaration

cs-api-definition
protected virtual void OnPropertyChanged(string propertyName = null)

Parameters

propertyName

string

The name of the property that has changed. If null, the caller member name is used.

UpdateValue<T>(ref T, T, Action<T>, string)

Updates a field's value, executes a callback with the old value, and raises the PropertyChanged event if the value has changed.

Declaration

cs-api-definition
protected bool UpdateValue<T>(ref T field, T value, Action<T> onChanged, string propertyName = null)

Parameters

field

T

A reference to the field to update.

value

T

The new value for the field.

onChanged

Action<T>

Action to invoke after the field value is changed, with the old value as parameter.

propertyName

string

The name of the property that is changing. If null, the caller member name is used.

Returns

bool

true if the value was changed, false otherwise.

UpdateValue<T>(ref T, T, string)

Updates a field's value and raises the PropertyChanged event if the value has changed.

Declaration

cs-api-definition
protected bool UpdateValue<T>(ref T field, T value, string propertyName = null)

Parameters

field

T

A reference to the field to update.

value

T

The new value for the field.

propertyName

string

The name of the property that is changing. If null, the caller member name is used.

Returns

bool

true if the value was changed, false otherwise.

Events

PropertyChanged

Occurs when a property value changes.

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler

Implements INotifyPropertyChanged.PropertyChanged