mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
fix: 暂时忽略吐司通知报错
This commit is contained in:
@@ -39,18 +39,25 @@ internal class NotificationImplWinRT : INotificationPoster, IDisposable
|
||||
|
||||
public void ShowNotification(NotificationContent content)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
try
|
||||
{
|
||||
var builder = new ToastContentBuilder().AddText(content.Body).AddText(content.Summary);
|
||||
|
||||
foreach (var action in content.Actions)
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
builder.AddButton(new ToastButton()
|
||||
.SetContent(action.Label)
|
||||
.AddArgument(action.Tag));
|
||||
}
|
||||
var builder = new ToastContentBuilder().AddText(content.Body).AddText(content.Summary);
|
||||
|
||||
builder.Show();
|
||||
});
|
||||
foreach (var action in content.Actions)
|
||||
{
|
||||
builder.AddButton(new ToastButton()
|
||||
.SetContent(action.Label)
|
||||
.AddArgument(action.Tag));
|
||||
}
|
||||
|
||||
builder.Show();
|
||||
});
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,9 +143,16 @@ internal class NotificationImplWpf : INotificationPoster
|
||||
wpfcontent.RightButtonAction = () => ActionActivated?.Invoke(this, action.Tag);
|
||||
}
|
||||
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
try
|
||||
{
|
||||
_notificationManager.Show(wpfcontent, expirationTime: expirationTime, ShowXbtn: false);
|
||||
});
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
_notificationManager.Show(wpfcontent, expirationTime: expirationTime, ShowXbtn: false);
|
||||
});
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user