Share via


ObservableObject.SetProperty<T> Method

Definition

Sets the property.

protected virtual bool SetProperty<T>(ref T? backingStore, T? value, string propertyName = "", Action onChanging = default, Action onChanged = default, Func<T,T,bool>? validateValue = default);

Type Parameters

T

The 1st type parameter.

Parameters

backingStore
T

Backing store.

value
T

Value.

propertyName
System.String

Property name.

onChanging
System.Action
onChanged
System.Action

On changed.

validateValue
System.Func<T,T,System.Boolean>

Validates value.

Returns

System.Boolean

true, if property was set, false otherwise.

Applies to