Skip to content

Instantly share code, notes, and snippets.

@jasondown
Created August 3, 2021 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasondown/35cc61282376e5d8ef3766e5ed5ea978 to your computer and use it in GitHub Desktop.
Save jasondown/35cc61282376e5d8ef3766e5ed5ea978 to your computer and use it in GitHub Desktop.
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Jason.Down.Blog.MutliImageAddinDemo.Annotations;
namespace Jason.Down.Blog.MutliImageAddinDemo.ViewModel
{
/// <summary>
/// This class exposes the default behaviour for INotifyProperyChanged.
/// </summary>
public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Called when a property in the ViewModel has been changed and wishes to send out a notification.
/// </summary>
/// <param name="propertyName">Name of the property.</param>
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChangedEventHandler 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