private async void plusOneButton_Tapped(object sender, TappedRoutedEventArgs e) { int result = await PostManagement.PlusOne(post.postID, !post.isPlusonedByViewer); if (result == 0) { post.isPlusonedByViewer = !post.isPlusonedByViewer; //plusOneButton.IsPressed = !plusOneButton.IsPressed; } }
private async void AppBarToggleButton_Unchecked(object sender, RoutedEventArgs e) { int result = await PostManagement.PlusOne(post.postID, !post.isPlusonedByViewer); if (result == 0) { post.isPlusonedByViewer = false; } else { //tu error (sender as AppBarToggleButton).IsChecked = true; } }