You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
731 B

2 years ago
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace BBWYB.Client.Models
{
public class NotifyObject : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName]string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
protected bool Set<T>(ref T oldValue, T newValue, [CallerMemberName]string propertyName = "")
{
if (Equals(oldValue, newValue))
return false;
oldValue = newValue;
OnPropertyChanged(propertyName);
return true;
}
}
}