ensure all notifications are raised on ui thread.
MODIFY
WalletWasabi.Gui/Helpers/NotificationHelpers.cs
WalletWasabi.Gui/Helpers/NotificationHelpers.cs
using Avalonia.Controls.Notifications;
+using ReactiveUI;
using Splat;
-using System;
-using System.Collections.Generic;
-using System.Text;
+using System.Reactive.Concurrency;
namespace WalletWasabi.Gui.Helpers
{
@@ -15,22 +14,30 @@ namespace WalletWasabi.Gui.Helpers
public static void Success (string message, string title = "Success!")
{
- GetNotificationManager().Show(new Notification(title, message, NotificationType.Success));
+ RxApp.MainThreadScheduler
+ .Schedule(() => GetNotificationManager()
+ .Show(new Notification(title, message, NotificationType.Success)));
}
public static void Information (string message, string title = "Info!")
{
- GetNotificationManager().Show(new Notification(title, message, NotificationType.Warning));
+ RxApp.MainThreadScheduler
+ .Schedule(() => GetNotificationManager()
+ .Show(new Notification(title, message, NotificationType.Warning)));
}
public static void Warning (string message, string title = "Warning!")
{
- GetNotificationManager().Show(new Notification(title, message, NotificationType.Warning));
+ RxApp.MainThreadScheduler
+ .Schedule(() => GetNotificationManager()
+ .Show(new Notification(title, message, NotificationType.Warning)));
}
public static void Error(string message, string title = "Error!")
{
- GetNotificationManager().Show(new Notification(title, message, NotificationType.Error));
+ RxApp.MainThreadScheduler
+ .Schedule(() => GetNotificationManager()
+ .Show(new Notification(title, message, NotificationType.Error)));
}
}
}

ensure all notifications are raised on ui thread.