windows8xaml中的MessageDialog
我的代码:windows8xaml中的MessageDialog,xaml,windows-8,messagedialog,Xaml,Windows 8,Messagedialog,我的代码: MessageDialog msg = new MessageDialog("Are you sure to cancel the booking?", "Confirmation"); msg.Commands.Add(new UICommand("Confirm", new UICommandInvokedHandler(CommandHandler))); msg.Commands.Add(new UICo
MessageDialog msg = new MessageDialog("Are you sure to cancel the booking?", "Confirmation");
msg.Commands.Add(new UICommand("Confirm", new UICommandInvokedHandler(CommandHandler)));
msg.Commands.Add(new UICommand("Cancel", new UICommandInvokedHandler(CommandHandler)));
msg.DefaultCommandIndex = 1;
msg.CancelCommandIndex = 1;
await msg.ShowAsync();
private async void CommandHandler(IUICommand command)
{
var commandLabel = command.Label;
switch (commandLabel)
{
case "Confirm":
CancelBookingTickets();
break;
case "Cancel":
break;
}
}
protected async void CancelBookingTickets()
{
MessageDialog msg1 = new MessageDialog("The cancellation process is complete", "Complete");
await msg1.ShowAsync();
}
我试图在我的Windows 8 xaml应用程序中使用嵌套消息对话框,但当我到达msg1.ShowAsync()
,它会触发一个异常,说“访问被拒绝”
有人能帮我解决这个问题吗?您同时面临多个
消息对话框的问题