= Implementing INotifyPropertyChanged =

It's changed a lot over the years. Here is the latest iteration that I use.

{{{#!highlight csharp

private BindingList<string> _Area = new BindingList<string>();
public BindingList<string> Area
{
    get => _Area;
    set => SetField<BindingList<string>>(ref _Area, value);
}

//...

public event PropertyChangedEventHandler PropertyChanged;

protected void SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
    field = value;
    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}}}

Suppose that the value you are setting with SetField is a property of a Model object. You may get an error that says, "A non ref-returning property or indexer may not be used as an out or ref value." There is an easy fix for this.

{{{#!hightlight csharp
private BindingList<string> _Area = new BindingList<string>();
public BindingList<string> Area
{
    get => _Area;
    set => _Area = SetField<BindingList<string>>(value);
}

//...

public event PropertyChangedEventHandler PropertyChanged;

protected void SetField<T>(T value, [CallerMemberName] string propertyName = null)
{
    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    return value;
}
}}}