Skip to content

Commit c246712

Browse files
authored
Open github new issue page from Toast (#1916)
1 parent cd52249 commit c246712

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

Files/App.xaml.cs

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,16 @@ protected override async void OnActivated(IActivatedEventArgs args)
366366
}
367367
}
368368
break;
369+
370+
case ActivationKind.ToastNotification:
371+
var eventArgsForNotification = args as ToastNotificationActivatedEventArgs;
372+
if (eventArgsForNotification.Argument == "report")
373+
{
374+
// Launch the URI and open log files location
375+
//SettingsViewModel.OpenLogLocation();
376+
SettingsViewModel.ReportIssueOnGitHub();
377+
}
378+
break;
369379
}
370380

371381
rootFrame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());
@@ -437,16 +447,16 @@ private static void AppUnhandledException(Exception ex)
437447
BindingGeneric = new ToastBindingGeneric()
438448
{
439449
Children =
440-
{
441-
new AdaptiveText()
442450
{
443-
Text = ResourceController.GetTranslation("ExceptionNotificationHeader")
451+
new AdaptiveText()
452+
{
453+
Text = ResourceController.GetTranslation("ExceptionNotificationHeader")
454+
},
455+
new AdaptiveText()
456+
{
457+
Text = ResourceController.GetTranslation("ExceptionNotificationBody")
458+
}
444459
},
445-
new AdaptiveText()
446-
{
447-
Text = ResourceController.GetTranslation("ExceptionNotificationBody")
448-
}
449-
},
450460
AppLogoOverride = new ToastGenericAppLogo()
451461
{
452462
Source = "ms-appx:///Assets/error.png"
@@ -456,13 +466,13 @@ private static void AppUnhandledException(Exception ex)
456466
Actions = new ToastActionsCustom()
457467
{
458468
Buttons =
459-
{
460-
new ToastButton(ResourceController.GetTranslation("ExceptionNotificationReportButton"), "report")
461469
{
462-
ActivationType = ToastActivationType.Foreground
470+
new ToastButton(ResourceController.GetTranslation("ExceptionNotificationReportButton"), "report")
471+
{
472+
ActivationType = ToastActivationType.Foreground
473+
}
463474
}
464475
}
465-
}
466476
};
467477

468478
// Create the toast notification

0 commit comments

Comments
 (0)