Skip to content

Instantly share code, notes, and snippets.

@runegri
Created August 15, 2014 10:05
Show Gist options
  • Save runegri/459fd4330dd54e8f6103 to your computer and use it in GitHub Desktop.
Save runegri/459fd4330dd54e8f6103 to your computer and use it in GitHub Desktop.
public abstract class ViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment