예제 #1
0
        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();
        }
예제 #2
0
 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)
         }
     });
 }
예제 #3
0
 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")
     });
 }
예제 #4
0
        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");
        }
예제 #5
0
 private async void ShowShortTextMessageBox(object sender, RoutedEventArgs e)
 {
     await PopupPresenterHost.ShowMessageBoxAsync("This is a short message text sample.", Title : "Test Title");
 }