Add WalletWatcher
MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
+using System.Collections.Generic;
using System.Linq;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
@@ -40,6 +41,7 @@ public partial class MainViewModel : ViewModelBase
[AutoNotify] private double _windowWidth;
[AutoNotify] private double _windowHeight;
[AutoNotify] private PixelPoint? _windowPosition;
+ private readonly WalletWatcher _walletWatcher;
public MainViewModel()
{
@@ -172,7 +174,12 @@ public partial class MainViewModel : ViewModelBase
}
});
- SearchBar = new SearchBarViewModel(SearchItemProvider.GetSearchItems());
+ _walletWatcher = new WalletWatcher(Services.WalletManager);
+
+ var items = SearchItemProvider.GetSearchItems()
+ .Merge(_walletWatcher.Transactions
+ .Select(r => new NonActionableSearchItem(r.Amount.ToString(), r.Label, "Transactions", new List<string>(), null ){ IsDefault = true}));
+ SearchBar = new SearchBarViewModel(items);
}
public TargettedNavigationStack MainScreen { get; }

ADD
WalletWasabi.Fluent/ViewModels/WalletWatcher.cs
+using System.Reactive;
+using System.Reactive.Linq;
+using NBitcoin;
+using WalletWasabi.Blockchain.Analysis.Clustering;
+using WalletWasabi.Blockchain.TransactionProcessing;
+using WalletWasabi.Blockchain.Transactions;
+using WalletWasabi.Wallets;
+
+namespace WalletWasabi.Fluent.ViewModels;
+
+public class WalletWatcher
+{
+ public WalletWatcher(WalletManager walletManager)
+ {
+ var added = Observable
+ .FromEventPattern<Wallet>(Services.WalletManager, nameof(WalletManager.WalletAdded))
+ .Select(_ => Unit.Default);
+ var transactionProcessed = Observable
+ .FromEventPattern<ProcessedResult>(Services.WalletManager, nameof(WalletManager.WalletRelevantTransactionProcessed))
+ .Select(_ => Unit.Default);
+ }
+
+ public IObservable<TransactionSummary> Transactions => GetTransactions();
+
+ private IObservable<TransactionSummary> GetTransactions()
+ {
+ return new[]
+ {
+ new TransactionSummary
+ {
+ Amount = Money.Zero,
+ BlockIndex = 1,
+ Height = 1,
+ TransactionId = 123,
+ IsOwnCoinjoin = true,
+ DateTime = DateTimeOffset.Now,
+ Label = new SmartLabel("Hola")
+ }
+ }.ToObservable();
+ }
+}
\ No newline at end of file

Add WalletWatcher