private async void Payment_Click(object sender, RoutedEventArgs e) { if (int.TryParse(autobox.Text, out int a)) { CalculatorDialog calculatorDialog = new CalculatorDialog(CalculateMoney(), a, selected); var result = await calculatorDialog.ShowAsync(); if (result == ContentDialogResult.Primary) { SetToDefault(); if (new PayLateChargeBS().HaveLateCharge(customer.CusID)) { ContentDialog completeDialog = new ContentDialog { Title = "Pay late charge", Content = "You are having unpaid late charge, would you like to pay?", CloseButtonText = "Maybe next time", PrimaryButtonText = "OK" }; ContentDialogResult dialogResult = await completeDialog.ShowAsync(); if (dialogResult == ContentDialogResult.Primary) { MainPage.mainFrame.Navigate(typeof(LateChargePage), customer.CusID); } } } else { DisplayDialog("Error", "There are errors happened in payment, please try again", "OK"); } } }
void OnClick(object sender, EventArgs eventArgs) { CalculatorDialog dialog = CreateDialog(); dialog.Show(); }