Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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