Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Binding]
public class PropertyChangedExample : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
private string someProperty;
public string SomeProperty
{
get
{
return someProperty;
}
set
{
if (someProperty == value)
{
return;
}
someProperty = value;
OnPropertyChanged("SomeValue");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment