Method RaiseAndSetIfChanged
RaiseAndSetIfChanged<TRet>(ref TRet, TRet, string)
Raises a property changed event if the specified field is changed. Sets the field to the new value if changed.
Declaration
protected TRet RaiseAndSetIfChanged<TRet>(ref TRet backingField, TRet newValue, string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
TRet | backingField | The field backing the property. |
TRet | newValue | The new value for the property. |
string | propertyName | The name of the property. |
Returns
Type | Description |
---|---|
TRet | The new value. |
Type Parameters
Name | Description |
---|---|
TRet | The type of the property. |