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
storageTThe reference to the backing field of the property.
valueTThe new value of the property.
propertyNamestringThe name of the property. This is optional and will be automatically set by the compiler if not provided.
Returns
- bool
trueif the property value has changed; otherwise,false.
Type Parameters
TThe type of the property.