Remove dependency of owner type
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -59,7 +59,10 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Password = "";
TimeLeftTillRoundTimeout = TimeSpan.Zero;
- CoinsList = new CoinListViewModel();
+ CoinsList = new CoinListViewModel()
+ {
+ CanDequeueCoins = true
+ };
Observable
.FromEventPattern<SmartCoin>(CoinsList, nameof(CoinsList.DequeueCoinsPressed))

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
<DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource CoinListView_More}" />
</MenuItem.Icon>
</MenuItem>
- <MenuItem Header="Dequeue from CoinJoin" Command="{Binding DequeueCoin}">
+ <MenuItem IsVisible="{Binding CanBeDequeued}" Header="Dequeue from CoinJoin" Command="{Binding DequeueCoin}">
<MenuItem.Icon>
<DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource CoinListView_DequeueCoin}" />
</MenuItem.Icon>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -72,6 +72,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public ReadOnlyObservableCollection<CoinViewModel> Coins => _coinViewModels;
public bool DisplayCommonOwnershipWarning { get; set; } = false;
+ public bool CanDequeueCoins { get; set; } = false;
private SortExpressionComparer<CoinViewModel> MyComparer
{
@@ -435,7 +436,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
RootList.RemoveMany(coinToRemove.Select(kp => kp.Value));
- var newCoinViewModels = coinToAdd.Select(c => new CoinViewModel(this, c)).ToArray();
+ var newCoinViewModels = coinToAdd.Select(c => new CoinViewModel(this, c, CanDequeueCoins)).ToArray();
foreach (var cvm in newCoinViewModels)
{
SubscribeToCoinEvents(cvm);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
@@ -34,15 +34,16 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public CoinListViewModel Owner { get; }
private Global Global { get; }
-
+ public bool CanBeDequeued { get; }
public ReactiveCommand<Unit, Unit> DequeueCoin { get; }
- public CoinViewModel(CoinListViewModel owner, SmartCoin model)
+ public CoinViewModel(CoinListViewModel owner, SmartCoin model, bool canBeDequeued)
{
Global = Locator.Current.GetService<Global>();
Model = model;
Owner = owner;
+ CanBeDequeued = canBeDequeued;
RefreshSmartCoinStatus();

Remove dependency of owner type