Add completed solution for chapter 3

This commit is contained in:
Alvin Ashcraft
2023-05-13 12:29:36 -04:00
parent e29c389e86
commit 5ec4e6e6b4
25 changed files with 861 additions and 0 deletions
@@ -0,0 +1,28 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace MyMediaCollection.ViewModels
{
public class BindableBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
protected bool SetProperty<T>(ref T originalValue, T newValue, [CallerMemberName] string propertyName = null)
{
if (Equals(originalValue, newValue))
{
return false;
}
originalValue = newValue;
OnPropertyChanged(propertyName);
return true;
}
}
}