public static async Task ShowDialogAsync(string message, string title)
{
// make sure to call MessageDialog.ShowAsync on the ui thread.
// force this by rescheduling the call using dispatcher.RunAync.
var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
await dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
var dialog = new Windows.UI.Popups.MessageDialog(message, title);
dialog.Commands.Add(new Windows.UI.Popups.UICommand("Cancel", a => { }));
await dialog.ShowAsync();
});
}