Method SetPropertyAndValidate
SetPropertyAndValidate<T>(ref T, T, Action, string)
Sets the property value and performs validation.
protected virtual bool SetPropertyAndValidate<T>(ref T storage, T value, Action onChanged, string propertyName = null)
Parameters
storage
TThe reference to the property storage.
value
TThe new value to set.
onChanged
ActionThe action to be executed when the property value changes.
propertyName
stringThe name of the property.
Returns
- bool
True if the property value was changed; otherwise, false.
Type Parameters
T
The type of the property.
SetPropertyAndValidate<T>(ref T, T, string)
Sets the property value and performs validation.
protected virtual bool SetPropertyAndValidate<T>(ref T storage, T value, string propertyName = null)
Parameters
storage
TThe reference to the property storage.
value
TThe new value to set.
propertyName
stringThe name of the property.
Returns
- bool
True if the property value was changed; otherwise, false.
Type Parameters
T
The type of the property.