New to Telerik UI for .NET MAUIStart a free 30-day trial

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

Definition

Constructors

C#
protected NotifyPropertyChangedBase()

Methods

Raises the PropertyChanged event.

C#
protected virtual void OnPropertyChanged(string propertyName = null)
Parameters:propertyNamestring

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

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

C#
protected bool UpdateValue<T>(ref T field, T value, Action<T> onChanged, string propertyName = null)
Parameters:fieldT

A reference to the field to update.

valueT

The new value for the field.

onChangedAction<T>

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

propertyNamestring

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.

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

C#
protected bool UpdateValue<T>(ref T field, T value, string propertyName = null)
Parameters:fieldT

A reference to the field to update.

valueT

The new value for the field.

propertyNamestring

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

Occurs when a property value changes.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged