Last active
June 11, 2020 00:51
-
-
Save AlbertoDePena/806429843da2bb96675648df7f1a6d55 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
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