PT Run Service notification improvements (#9772)

This commit is contained in:
Davide Giacometti
2021-02-19 18:17:52 +01:00
committed by GitHub
parent a29b3aa500
commit ff4a78a7f9
5 changed files with 80 additions and 20 deletions

View File

@@ -84,14 +84,18 @@ namespace Wox
});
}
public void ShowNotification(string text)
public void ShowNotification(string text, string secondaryText = null)
{
var builder = new ToastContentBuilder().AddText(text);
if (!string.IsNullOrWhiteSpace(secondaryText))
{
builder.AddText(secondaryText);
}
Application.Current.Dispatcher.Invoke(() =>
{
ToastContent toastContent = new ToastContentBuilder()
.AddText(text)
.GetToastContent();
var toast = new ToastNotification(toastContent.GetXml());
var toast = new ToastNotification(builder.GetToastContent().GetXml());
DesktopNotificationManagerCompat.CreateToastNotifier().Show(toast);
});
}