MessageDialog dialog = new MessageDialog("Are you sure you want to exit?"); dialog.Title = "Exit Application"; dialog.Commands.Add(new UICommand("Yes")); dialog.Commands.Add(new UICommand("No")); dialog.DefaultCommandIndex = 0; dialog.CancelCommandIndex = 1; IUICommand result = await dialog.ShowAsync();
var dialog = new MessageDialog("Hello from Assist!","Assist"); dialog.Commands.Add(new UICommand("OK") { Id = 0 }); await dialog.ShowAsync();This example shows a basic message dialog box with the title "Assist" and the message "Hello from Assist!". The dialog box has a single button, "OK". The result of the user's selection is not used in this example. Package Library: Windows.UI.Popups In both examples, the Windows.UI.Popups package library was used.