Created
September 5, 2012 23:10
-
-
Save aaronpowell/3647219 to your computer and use it in GitHub Desktop.
INPC bubble
This file contains hidden or 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
| public class Something : INotifyPropertyChanged { | |
| private bool foo; | |
| public bool Foo { | |
| get { | |
| return foo; | |
| } | |
| set { | |
| if(foo == value) return; | |
| foo = value; | |
| OnPropertyChanged("Foo"); | |
| } | |
| } | |
| //INPC impl | |
| } | |
| public class Bar { | |
| private readonly something; | |
| public Bar(Something something) { | |
| this.something = something; | |
| } | |
| public Foo { | |
| get { return something.Foo; } | |
| set { something.Foo = value; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment