Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created February 7, 2017 08:25
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 jfversluis/fa7b558f97563febc84d4f6ece7c4ebb to your computer and use it in GitHub Desktop.
Save jfversluis/fa7b558f97563febc84d4f6ece7c4ebb to your computer and use it in GitHub Desktop.
PageModel for the INotifyPropertyChanged page
using System.ComponentModel;
namespace propertychangedfodysample
{
public class propertychangedfodysamplePageModel : INotifyPropertyChanged
{
private string _sampleText;
public string SampleText {
get { return _sampleText; }
set {
_sampleText = value;
OnPropertyChanged (nameof (SampleText));
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged (string name)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null) {
handler (this, new PropertyChangedEventArgs (name));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment