eksam/Päevaküsimus/NotificationBase.cs

22 lines
753 B
C#
Raw Normal View History

2017-01-26 17:50:33 +02:00
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Päevaküsimus
{
2017-01-26 19:32:16 +02:00
[Serializable()]
2017-01-26 17:50:33 +02:00
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));
}
}
}