Libation/Source/LibationWinForms/grid/AsyncNotifyPropertyChanged.cs

17 lines
639 B
C#

using Dinah.Core.Threading;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace LibationWinForms
{
public abstract class AsyncNotifyPropertyChanged : SynchronizeInvoker, INotifyPropertyChanged
{
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)));
}
}