Skip to content

Commit

Permalink
fixed notification activation for urls
Browse files Browse the repository at this point in the history
  • Loading branch information
lostmsu committed Sep 8, 2022
1 parent 602464e commit 2d5d338
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/BoilerplateApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ public void ShowNotification(string? title, string message, Uri? navigateTo, Tim
// can't inline because of crashes on Windows before 10
[MethodImpl(MethodImplOptions.NoInlining)]
static void ShowModernNotification(string? title, string message, Uri? navigateTo, TimeSpan? duration = null) {
var header = title == null ? null : new ToastHeader(title, title, navigateTo?.ToString());
var content = new ToastContent {
Launch = navigateTo?.ToString(),

Header = title == null ? null : new ToastHeader(title, title, navigateTo?.ToString()),
Header = header,

Visual = new ToastVisual {
BindingGeneric = new ToastBindingGeneric {
Expand All @@ -178,8 +179,11 @@ static void ShowModernNotification(string? title, string message, Uri? navigateT
}
};

if (navigateTo is not null)
if (navigateTo is not null) {
content.ActivationType = ToastActivationType.Protocol;
if (header is not null)
header.ActivationType = ToastActivationType.Protocol;
}

var contentXml = new XmlDocument();
contentXml.LoadXml(content.GetContent());
Expand Down

0 comments on commit 2d5d338

Please sign in to comment.