Skip to content

RxRecord.RaiseAndSetIfChanged(T, T, string?) method

Defined in

Type: RxRecord Namespace: ReactiveMarbles.Mvvm Assembly: ReactiveMarbles.Mvvm.dll

Applies to

net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.0

protected void RaiseAndSetIfChanged<T>(ref T backingField, T newValue, string? propertyName = null)

View source

Summary: RaiseAndSetIfChanged fully implements a Setter for a read-write property on a ReactiveObject, using CallerMemberName to raise the notification and the ref to the backing field to set the property.

Type parameters

NameDescription
TThe type of the value.

Parameters

NameTypeDescription
ref backingFieldTA Reference to the backing field for this property.
newValueTThe new value.
propertyName = nullstring?The name of the property, usually automatically provided through the CallerMemberName attribute.