Home > Windows 8 > WinJS Tricks: Access is denied exception with multiple MessageDialogs

WinJS Tricks: Access is denied exception with multiple MessageDialogs

Using what you learned in the previous episodes of the WinJS Tricks Series about MessageDialogs and their custom buttons, you can write the following code, that displays two MessageDialogs in a sequence:

var dlg = new MessageDialog( 'First message' );

dlg.commands.append( new UICommand( 'OK', function() {
  new MessageDialog( 'Second message' ).showAsync().then( function() {
    // Do something useful here...
  } );
} ) );

dlg.showAsync();

The “only” problem with this code is that it unmerficully crashes your app without any notification. If you run your app in Debug mode you can get the following Access is denied exception:

MessageDialog-Access-denied

Do you see the bug? If not, you can learn why that happens and how to fix it from the next episode of the series:

(720p, full screen view recommended)

 

Technorati-címkék: ,,,,

About these ads
Categories: Windows 8 Tags: , ,
  1. January 10, 2013 at 18:48 | #1

    great tut, thanks for sharing

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: