Add toggle on UI
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletCoins/WalletCoinViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Advanced/WalletCoins/WalletCoinViewModel.cs
@@ -13,6 +13,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Advanced.WalletCoins;
public partial class WalletCoinViewModel : ViewModelBase, IDisposable
{
private readonly CompositeDisposable _disposables = new();
+ [AutoNotify] private bool _isExcludedFromCoinJoin;
[AutoNotify] private Money _amount = Money.Zero;
[AutoNotify] private int _anonymitySet;
[AutoNotify] private SmartLabel _smartLabel = "";
@@ -27,9 +28,10 @@ public partial class WalletCoinViewModel : ViewModelBase, IDisposable
{
Coin = coin;
Amount = Coin.Amount;
+ IsExcludedFromCoinJoin = coin.IsExcludedFromCoinJoin;
+ ToggleExcludeCommand = ReactiveCommand.Create(() => coin.IsExcludedFromCoinJoin = !coin.IsExcludedFromCoinJoin, canExecute: this.WhenAnyValue(x => x.CoinJoinInProgress).Select(x => !x));
- ToggleSelectCommand = ReactiveCommand.Create(() => IsSelected = !IsSelected, canExecute: this.WhenAnyValue(x => x.CoinJoinInProgress).Select(x => !x));
-
+ Coin.WhenAnyValue(c => c.IsExcludedFromCoinJoin).Subscribe(x => IsExcludedFromCoinJoin = x).DisposeWith(_disposables);
Coin.WhenAnyValue(c => c.Confirmed).Subscribe(x => Confirmed = x).DisposeWith(_disposables);
Coin.WhenAnyValue(c => c.HdPubKey.Cluster.Labels).Subscribe(x => SmartLabel = x).DisposeWith(_disposables);
Coin.WhenAnyValue(c => c.HdPubKey.AnonymitySet).Subscribe(x => AnonymitySet = (int)x).DisposeWith(_disposables);
@@ -42,7 +44,7 @@ public partial class WalletCoinViewModel : ViewModelBase, IDisposable
this.WhenAnyValue(x => x.CoinJoinInProgress).Where(x => x).Subscribe(_ => IsSelected = false);
}
- public ICommand ToggleSelectCommand { get; }
+ public ICommand ToggleExcludeCommand { get; }
public SmartCoin Coin { get; }

MODIFY
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletCoins/WalletCoinsView.axaml
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletCoins/WalletCoinsView.axaml
Background="Transparent"
x:CompileBindings="True" x:DataType="walletcoins:WalletCoinViewModel">
<i:Interaction.Behaviors>
- <behaviors:ExecuteCommandOnDoubleTapped Command="{Binding ToggleSelectCommand, Mode=OneWay}" />
+ <behaviors:ExecuteCommandOnDoubleTapped Command="{Binding ToggleExcludeCommand, Mode=OneWay}" />
</i:Interaction.Behaviors>
<Border Name="PART_SelectionIndicator"
BorderThickness="2 0 0 0"

Add toggle on UI