I am developing a Windows 8 app in which I have to show a message alert. I am using a message dialog box. It gives me this error:
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
in my Windows 8 app when calling msgDialogBox.ShowAsync();
. Why?
MessageDialog msgDialogBox = new MessageDialog("My message");
UICommand okBtn = new UICommand("OK");
okBtn.Invoked = OkBtnClick;
msgDialogBox.Commands.Add(okBtn);
//Cancel Button
UICommand cancelBtn = new UICommand("Cancel");
cancelBtn.Invoked = CancelBtnClick;
msgDialogBox.Commands.Add(cancelBtn);
await msgDialogBox.ShowAsync();