Table of Contents

Method SetProperty

Namespace
Innova.Data.Entity
Assembly
Innova.Data.dll

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

Sets the value of a property and raises the PropertyChanged event if the value has changed.

protected virtual bool SetProperty<T>(ref T storage, T value, string propertyName = null)

Parameters

storage T

The reference to the backing field of the property.

value T

The new value of the property.

propertyName string

The name of the property.

Returns

bool

true if the property value has changed; otherwise, false.

Type Parameters

T

The type of the property.

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

Sets the value of a property and raises the PropertyChanged event if the value has changed. Additionally, invokes the specified action when the property value has changed.

protected virtual bool SetProperty<T>(ref T storage, T value, Action onChanged, string propertyName = null)

Parameters

storage T

The reference to the backing field of the property.

value T

The new value of the property.

onChanged Action

The action to invoke when the property value has changed.

propertyName string

The name of the property.

Returns

bool

true if the property value has changed; otherwise, false.

Type Parameters

T

The type of the property.