Open
Description
namespace N
{
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
public class C : INotifyPropertyChanged
{
private string p;
public event PropertyChangedEventHandler PropertyChanged;
public string P
{
get => this.p;
set
{
if (string.Equals(value, this.p, StringComparison.Ordinal))
{
return;
}
this.p = value;
this.OnPropertyChanged();
}
}
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}
Above is not very nice as the expectation is that the property gets the assigned value. /cc @jnm2