vue-java-tutorials/CSharp/WPFTutorial/WPF-13-INotifyPropertyChanged/ViewModels/ViewModelBase.cs

14 lines
421 B
C#
Raw Normal View History

2025-06-22 20:21:42 +08:00
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace WPF_13_INotifyPropertyChanged.ViewModels;
public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}