using System; using System.ComponentModel; using System.Runtime.CompilerServices; namespace Päevaküsimus { public class NotificationBase : INotifyPropertyChanged { [field: NonSerialized()] public event PropertyChangedEventHandler PropertyChanged; // This method is called by the Set accessor of each property. // The CallerMemberName attribute that is applied to the optional propertyName // parameter causes the property name of the caller to be substituted as an argument. public void NotifyPropertyChanged([CallerMemberName] String propertyName = "") { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }