Update version

This commit is contained in:
Daniel Clark
2021-02-15 21:21:50 +00:00
parent b96155be73
commit 9fa476e57d
25 changed files with 726 additions and 68 deletions
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace NotificationFlyoutSample
{
public class ObservableObject : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged([CallerMemberName] string propertyName = "") => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
protected virtual bool SetProperty<T>(ref T backingStore, T value, [CallerMemberName] string propertyName = "",
Action onChanged = null, Func<T, T, bool> validateValue = null)
{
if (EqualityComparer<T>.Default.Equals(backingStore, value))
return false;
if (validateValue != null && !validateValue(backingStore, value))
return false;
backingStore = value;
onChanged?.Invoke();
OnPropertyChanged(propertyName);
return true;
}
}
}