Use observable trigger to update details view data
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/Details/CoinJoinDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/Details/CoinJoinDetailsViewModel.cs
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows.Input;
@@ -14,6 +15,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History.Details;
public partial class CoinJoinDetailsViewModel : RoutableViewModel
{
private readonly CoinJoinHistoryItemViewModel _coinJoin;
+ private readonly IObservable<Unit> _updateTrigger;
[AutoNotify] private string _date = "";
[AutoNotify] private string _status = "";
@@ -21,9 +23,10 @@ public partial class CoinJoinDetailsViewModel : RoutableViewModel
[AutoNotify] private string _coinJoinFeeString = "";
[AutoNotify] private uint256? _transactionId;
- public CoinJoinDetailsViewModel(CoinJoinHistoryItemViewModel coinJoin)
+ public CoinJoinDetailsViewModel(CoinJoinHistoryItemViewModel coinJoin, IObservable<Unit> updateTrigger)
{
_coinJoin = coinJoin;
+ _updateTrigger = updateTrigger;
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
NextCommand = CancelCommand;
@@ -45,9 +48,7 @@ public partial class CoinJoinDetailsViewModel : RoutableViewModel
{
base.OnNavigatedTo(isInHistory, disposables);
- Observable
- .FromEventPattern(_coinJoin, nameof(PropertyChanged))
- .Throttle(TimeSpan.FromMilliseconds(100))
+ _updateTrigger
.Subscribe(_ => Update())
.DisposeWith(disposables);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/Details/CoinJoinsDetailsViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/Details/CoinJoinsDetailsViewModel.cs
using System.Collections.ObjectModel;
using System.Linq;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows.Input;
@@ -16,6 +17,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History.Details;
public partial class CoinJoinsDetailsViewModel : RoutableViewModel
{
private readonly CoinJoinsHistoryItemViewModel _coinJoinGroup;
+ private readonly IObservable<Unit> _updateTrigger;
[AutoNotify] private string _date = "";
[AutoNotify] private string _status = "";
@@ -23,9 +25,10 @@ public partial class CoinJoinsDetailsViewModel : RoutableViewModel
[AutoNotify] private string _coinJoinFeeString = "";
[AutoNotify] private ObservableCollection<uint256>? _transactionIds;
- public CoinJoinsDetailsViewModel(CoinJoinsHistoryItemViewModel coinJoinGroup)
+ public CoinJoinsDetailsViewModel(CoinJoinsHistoryItemViewModel coinJoinGroup, IObservable<Unit> updateTrigger)
{
_coinJoinGroup = coinJoinGroup;
+ _updateTrigger = updateTrigger;
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
NextCommand = CancelCommand;
@@ -47,9 +50,7 @@ public partial class CoinJoinsDetailsViewModel : RoutableViewModel
{
base.OnNavigatedTo(isInHistory, disposables);
- Observable
- .FromEventPattern(_coinJoinGroup, nameof(PropertyChanged))
- .Throttle(TimeSpan.FromMilliseconds(100))
+ _updateTrigger
.Subscribe(_ => Update())
.DisposeWith(disposables);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinHistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinHistoryItemViewModel.cs
@@ -36,7 +36,7 @@ public class CoinJoinHistoryItemViewModel : HistoryItemViewModelBase
ShowDetailsCommand = ReactiveCommand.Create(() =>
RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To(
- new CoinJoinDetailsViewModel(this)));
+ new CoinJoinDetailsViewModel(this, updateTrigger)));
DateString = $"{Date.ToLocalTime():MM/dd/yy HH:mm}";
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinsHistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinsHistoryItemViewModel.cs
@@ -30,7 +30,9 @@ public class CoinJoinsHistoryItemViewModel : HistoryItemViewModelBase
CoinJoinTransactions = new List<TransactionSummary>();
IsCoinJoin = true;
- ShowDetailsCommand = ReactiveCommand.Create(() => RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To(new CoinJoinsDetailsViewModel(this)));
+ ShowDetailsCommand = ReactiveCommand.Create(() =>
+ RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To(
+ new CoinJoinsDetailsViewModel(this, _updateTrigger)));
Add(firstItem);
}

Use observable trigger to update details view data