Created
October 21, 2017 08:42
-
-
Save andy51002000/ac78af189df2fd28289bd61056be5fb7 to your computer and use it in GitHub Desktop.
Base class for all ViewModel that implements INotifyPropertyChanged
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 SimpleMVVM.ViewModels | |
{ | |
public class ViewModelBase : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
public void NotifyPropertyChanged(string propertyName) | |
{ | |
PropertyChangedEventHandler handler = PropertyChanged; | |
if( handler != null) | |
{ | |
PropertyChangedEventArgs args = new PropertyChangedEventArgs(propertyName); | |
handler(this, args); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment