// Event Methods private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (this.ValidateForm()) { if (TransactionForm == "Add Access Accounts") { TransactionResult = AccountData.AddAccount(); args.Cancel = false; } else if (TransactionForm == "Edit Access Accounts") { TransactionResult = AccountData.EditAccount(); args.Cancel = false; } } else { args.Cancel = true; } }