MessageDialog

MessageDialog is the Windows Runtime version of the classic message box. It blocks interaction with the rest of the app until it is dismissed. The following code shows the MessageDialog in Figure 14.10:

async Task ShowDialog() {   MessageDialog dialog = new MessageDialog("MessageDialog Content",                                            "MessageDialog Title");   await dialog.ShowAsync(); }

Image

FIGURE 14.10 MessageDialog can show a title, content, and button(s).

Notice that the method to show the dialog (ShowAsync) is asynchronous. There is no synchronous version of this method, which is typical for Windows ...

Get Universal Windows® Apps with XAML and C# 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.