private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) { var ex = e.Exception; e.Handled = true; await PopupPresenterHost.ShowMessageBoxAsync("{ex.Message}{Environment.NewLine}{ex.StackTrace}"); //await new MessageDialog($"{ex.Message}{Environment.NewLine}{ex.StackTrace}").ShowAsync(); }
private async void SampleDeleteMessageBox(object sender, RoutedEventArgs e) { await PopupPresenterHost.ShowMessageBoxAsync("Are you sure you want to delete?", Title : "Delete File?", Commands : new MessageBoxCommand[] { new MessageBoxCommand("Delete", "\uE74D", async() => { await new MessageDialog("Success message.").ShowAsync(); }) { Background = new SolidColorBrush(Colors.Red), BorderBrush = new SolidColorBrush(Colors.Red), Foreground = new SolidColorBrush(Colors.White) }, new MessageBoxCommand("Cancel", "\uE10A") { Foreground = new SolidColorBrush(Colors.White) } }); }
private async void SampleCopyFileMessageBox(object sender, RoutedEventArgs e) { await PopupPresenterHost.ShowMessageBoxAsync("Another file with the same name found, How to continue?", Title : "Copy failure", Commands : new MessageBoxCommand[] { new MessageBoxCommand("Rename file", "\uE13E", async() => { await new MessageDialog("File renamed and copied.").ShowAsync(); }) { Background = new SolidColorBrush(Colors.Red), BorderBrush = new SolidColorBrush(Colors.Red), Foreground = new SolidColorBrush(Colors.White) }, new MessageBoxCommand("Replace", "\uE19C", async() => { await new MessageDialog("File replaced.").ShowAsync(); }) { Foreground = new SolidColorBrush(Colors.White) }, new MessageBoxCommand("Cancel", "\uE10A") }); }
private async void ShowLongTextMessageBox(object sender, RoutedEventArgs e) { var msg = await FileIO.ReadTextAsync(await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///DemoContent/LoremIpsum.txt", UriKind.RelativeOrAbsolute))); await PopupPresenterHost.ShowMessageBoxAsync(msg, Title : "Lorem Ipsum"); }
private async void ShowShortTextMessageBox(object sender, RoutedEventArgs e) { await PopupPresenterHost.ShowMessageBoxAsync("This is a short message text sample.", Title : "Test Title"); }