ReactiveUI icon indicating copy to clipboard operation
ReactiveUI copied to clipboard

Property setter RaiseAndSetIfChanged backing field cannot be altered

Open davidhagg opened this issue 14 years ago • 1 comments

If you have a property setter like this.RaiseAndSetIfChanged(x => x.TextToTranslate, value) you will have to call your backing field for the property _TextToTranslate

Our projects Resharper settings does not allow me to have a backing field named something with _underscore. This is a minor issue but would be nice to have.

davidhagg avatar Mar 06 '12 08:03 davidhagg

The most clean way is to use the overload where you pass the backing field by ref: this.RaiseAndSetIfChanged(x => x.TextToTranslate, ref this.textToTranslate, value) Or you can change theRxApp.GetFieldNameForPropertyNameFunc

johnnyelwailer avatar Mar 06 '12 12:03 johnnyelwailer