eksam/Päevaküsimus/NotificationBase.cs
2017-01-26 17:50:33 +02:00

21 lines
732 B
C#

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));
}
}
}