Last active
June 21, 2019 10:48
-
-
Save runceel/8ce477e2c5661a20405f0c042262273f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BindableBase : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
protected virtual bool SetProperty<T>(ref T field, T value, [CallerMemberName]string propertyName) | |
{ | |
if (EqualityComparer<T>.Default.Equals(storage, value)) return false; | |
storage = value; | |
RaisePropertyChanged(propertyName); | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment