Method SetPropertyAndValidate
SetPropertyAndValidate<T>(ref T, T, string)
Sets the value of a property and validates it.
protected virtual bool SetPropertyAndValidate<T>(ref T storage, T value, string propertyName = null)
Parameters
storage
TThe reference to the backing field of the property.
value
TThe new value of the property.
propertyName
stringThe name of the property. This is optional and will be automatically set by the compiler if not provided.
Returns
- bool
true
if the property value has changed; otherwise,false
.
Type Parameters
T
The type of the property.