notification onClick action
MODIFY
WalletWasabi.Fluent/Helpers/NotificationHelpers.cs
WalletWasabi.Fluent/Helpers/NotificationHelpers.cs
@@ -14,7 +14,7 @@ namespace WalletWasabi.Fluent.Helpers
{
public static class NotificationHelpers
{
- private const int DefaultNotificationTimeout = 7;
+ private const int DefaultNotificationTimeout = 10;
private static WindowNotificationManager? NotificationManager;
public static void SetNotificationManager(Window host)
@@ -29,19 +29,19 @@ namespace WalletWasabi.Fluent.Helpers
NotificationManager = notificationManager;
}
- public static void Show(string title, string message)
+ public static void Show(string title, string message, Action? onClick = null)
{
if (NotificationManager is { } nm)
{
- RxApp.MainThreadScheduler.Schedule(() => nm.Show(new Notification(title, message, NotificationType.Information, TimeSpan.FromSeconds(DefaultNotificationTimeout))));
+ RxApp.MainThreadScheduler.Schedule(() => nm.Show(new Notification(title, message, NotificationType.Information, TimeSpan.FromSeconds(DefaultNotificationTimeout), onClick)));
}
}
- public static void Show(ProcessedResult result)
+ public static void Show(ProcessedResult result, Action onClick)
{
if (TryGetNotificationInputs(result, out var title, out var message))
{
- Show(title, message);
+ Show(title, message, onClick);
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -120,12 +120,15 @@ namespace WalletWasabi.Fluent.ViewModels
{
var (sender, e) = arg;
- if (uiConfig.PrivacyMode || !e.IsNews || sender is not Wallet {IsLoggedIn: true, State: WalletState.Started})
+ if (uiConfig.PrivacyMode || !e.IsNews || sender is not Wallet {IsLoggedIn: true, State: WalletState.Started} wallet)
{
return;
}
- NotificationHelpers.Show(e);
+ if (_walletDictionary.TryGetValue(wallet, out var walletViewModel) && walletViewModel is WalletViewModel wvm)
+ {
+ NotificationHelpers.Show(e, () => wvm.NavigateAndHighlight(e.Transaction.GetHash()));
+ }
});
RxApp.MainThreadScheduler.Schedule(() => EnumerateWallets(walletManager));

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -2,8 +2,12 @@ using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Reactive;
+using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
+using System.Threading.Tasks;
+using NBitcoin;
+using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.History;
using WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles;
@@ -89,6 +93,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
public WalletBalanceChartTileViewModel BalanceChartTile { get; }
+ public void NavigateAndHighlight(uint256 txid)
+ {
+ Navigate().To(this, NavigationMode.Clear);
+
+ RxApp.MainThreadScheduler.Schedule(async () =>
+ {
+ await Task.Delay(500);
+ History.SelectTransaction(txid);
+ });
+ }
+
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
base.OnNavigatedTo(isInHistory, disposables);

notification onClick action