mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
PT Run Service notification improvements (#9772)
This commit is contained in:
committed by
GitHub
parent
a29b3aa500
commit
ff4a78a7f9
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user