0

My Code:

            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();            
    }

I am trying to use the nested MessageDialog box in my Windows 8 xaml app but when I reach to the msg1.ShowAsync(), it fires an exception saying "Access is denied".

Can anybody help me out with this problem?

master.fake
  • 487
  • 1
  • 6
  • 22

1 Answers1

1

You are facing problem of multiple MessageDialog at once.

How to allow for multiple popups at once in WinRT?

Community
  • 1
  • 1
Farhan Ghumra
  • 15,180
  • 6
  • 50
  • 115