Last active
March 29, 2018 06:53
-
-
Save RoryDungan/7f718e5e2e4e9782a36cbf5ee1b54c27 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
[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