Displaying Windows Dialogs

Sometimes, nothing beats a good old-fashioned modal dialog. A modal dialog blocks all user interaction with your app until the modal dialog gets its answer.

Modal dialogs are necessary when your app will not work without some crucial information. For example, a Weather app cannot display the weather without knowing your location. So it makes sense to use a modal dialog to ask for the user’s location when the app first runs.

You also can use modal dialogs in the same situations in which you would use JavaScript alerts: when you really need to get in a user’s face to convey critical warnings or information. You should use modal dialogs sparingly.

Note

JavaScript alerts do not work in Windows Store apps written with ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.