Disable selection if coin is CJ'ing
MODIFY
WalletWasabi.Fluent/ViewModels/CoinControl/Core/CoinCoinControlItemViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinControl/Core/CoinCoinControlItemViewModel.cs
@@ -20,6 +20,7 @@ public class CoinCoinControlItemViewModel : CoinControlItemViewModelBase
Labels = smartCoin.HdPubKey.Label;
BannedUntilUtc = smartCoin.BannedUntilUtc;
IsSelected = false;
+ CanBeSelected = !IsCoinjoining;
}
public SmartCoin SmartCoin { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/CoinControl/Core/CoinControlItemViewModelBase.cs
WalletWasabi.Fluent/ViewModels/CoinControl/Core/CoinControlItemViewModelBase.cs
using System.Collections.Generic;
using System.Linq;
using NBitcoin;
+using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Fluent.Helpers;
namespace WalletWasabi.Fluent.ViewModels.CoinControl.Core;
-public abstract partial class CoinControlItemViewModelBase : ViewModelBase, IHierarchicallySelectable
+public abstract class CoinControlItemViewModelBase : ViewModelBase, IHierarchicallySelectable
{
- [AutoNotify] private bool? _isSelected;
+ private bool? _isSelected;
public CoinControlItemViewModelBase(IEnumerable<IHierarchicallySelectable> children)
{
@@ -47,5 +48,21 @@ public abstract partial class CoinControlItemViewModelBase : ViewModelBase, IHie
public HierarchicalSelection HierarchicalSelection { get; }
+ public bool CanBeSelected { get; protected set; }
+
public IEnumerable<IHierarchicallySelectable> Selectables { get; }
+
+ public bool? IsSelected
+ {
+ get => _isSelected;
+ set
+ {
+ if (!CanBeSelected && value == true)
+ {
+ return;
+ }
+
+ this.RaiseAndSetIfChanged(ref _isSelected, value);
+ }
+ }
}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinControl/Core/PocketCoinControlItemViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinControl/Core/PocketCoinControlItemViewModel.cs
@@ -17,6 +17,7 @@ public class PocketCoinControlItemViewModel : CoinControlItemViewModelBase
IsCoinjoining = pocket.Coins.Any(x => x.CoinJoinInProgress);
AnonymityScore = (int) pocket.Coins.Max(x => x.HdPubKey.AnonymitySet);
Labels = pocket.Labels;
+ CanBeSelected = true;
}
private static IEnumerable<CoinCoinControlItemViewModel> GetChildren(Pocket pocket)

MODIFY
WalletWasabi.Fluent/Views/CoinControl/Core/Cells/SelectionCellView.axaml
WalletWasabi.Fluent/Views/CoinControl/Core/Cells/SelectionCellView.axaml
x:Class="WalletWasabi.Fluent.Views.CoinControl.Core.Cells.SelectionCellView"
x:DataType="core:CoinControlItemViewModelBase"
x:CompileBindings="True">
- <CheckBox IsChecked="{Binding IsSelected}" Command="{Binding HierarchicalSelection.ToggleSelection}" />
+ <CheckBox IsChecked="{Binding IsSelected}" IsEnabled="{Binding CanBeSelected}" Command="{Binding HierarchicalSelection.ToggleSelection}" />
</UserControl>

Disable selection if coin is CJ'ing