Last active
May 23, 2019 15:04
-
-
Save mr5z/cdb248d82908b68be88cda9e6a388942 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
// This assumes you are using PropertyChanged.Fody | |
class ViewModel : INotifyPropertyChanged | |
{ | |
public bool Enabled { get; set; } | |
// more properties | |
protected void OnPropertyChanged(object sender, PropertyChangedEventArgs e) | |
{ | |
switch (e.PropertyName) | |
{ | |
case nameof(Enabled): | |
HandleEnabledChanged(); | |
break; | |
} | |
} | |
void HandleEnabledChanged() | |
{ | |
Service.Record(Enabled); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment