Skip to content

Instantly share code, notes, and snippets.

Created June 13, 2020 17:10
What would you like to do?
BaseViewModel.cs code snippet
public class BaseViewModel : INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
protected void SetValue<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
if (EqualityComparer<T>.Default.Equals(field, value))
field = value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment