eksam/Päevaküsimus/NotificationBase.cs

22 lines
753 B
C#

using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Päevaküsimus
{
[Serializable()]
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));
}
}
}