only call notifyPropertyChanged if actually set to new value

This commit is contained in:
Robert McRackan 2022-05-13 16:30:46 -04:00
parent 0e46cdb514
commit 9bdcaa5eaa
2 changed files with 39 additions and 11 deletions

View file

@ -8,6 +8,8 @@ namespace LibationWinForms
{
public event PropertyChangedEventHandler PropertyChanged;
// per standard INotifyPropertyChanged pattern:
// https://docs.microsoft.com/en-us/dotnet/desktop/wpf/data/how-to-implement-property-change-notification
public void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
=> this.UIThreadAsync(() => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)));
}