//Checks if yes or no was clicked. private async void Button_Click(object sender, RoutedEventArgs e) { Button btn = (Button)sender; bool val; if (btn.Name == "btnNo") { val = false; } else if (btn.Name == "btnYes") { val = true; } else { val = false; } if (mainPage.FaceMode == "Front") { mainPage.frontImageConfirm(val); } else { await mainPage.sideImageConfirmAsync(val); } }