Skip to content

Instantly share code, notes, and snippets.

@AlbertoDePena
Last active June 11, 2020 00:51
Show Gist options
  • Save AlbertoDePena/806429843da2bb96675648df7f1a6d55 to your computer and use it in GitHub Desktop.
Save AlbertoDePena/806429843da2bb96675648df7f1a6d55 to your computer and use it in GitHub Desktop.
using System.ComponentModel;
namespace ViewModels
{
public interface IObservableObject : INotifyPropertyChanged
{
void RaisePropertyChanged(string propertyName);
}
public class ObservableObject : IObservableObject
{
public event PropertyChangedEventHandler PropertyChanged;
public void RaisePropertyChanged(string propertyName)
{
if (string.IsNullOrWhiteSpace(propertyName))
throw new ArgumentNullException(nameof(propertyName));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment