begin implementing coinjoin.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
@@ -15,23 +15,25 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private SmartCoin _model;
private int _privacyLevel;
private string _history;
+ private CoinListViewModelBase _owner;
- public CoinViewModel(CoinListViewModel owner, SmartCoin model)
+ public CoinViewModel(CoinListViewModelBase owner, SmartCoin model)
{
_model = model;
+ _owner = owner;
this.WhenAnyValue(x => x.IsSelected).Subscribe(selected =>
{
if (selected)
{
- if (!owner.SelectedCoins.Contains(this))
+ if (!_owner.SelectedCoins.Contains(this))
{
- owner.SelectedCoins.Add(this);
+ _owner.SelectedCoins.Add(this);
}
}
else
{
- owner.SelectedCoins.Remove(this);
+ _owner.SelectedCoins.Remove(this);
}
});
@@ -41,6 +43,17 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
});
}
+ public void ChangeOwner(CoinListViewModelBase newOwner)
+ {
+ var selected = IsSelected;
+
+ IsSelected = false;
+
+ _owner = newOwner;
+
+ IsSelected = selected;
+ }
+
public bool Confirmed => _model.Confirmed;
public bool IsSelected

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -8,7 +8,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public class SendTabViewModel : WalletActionViewModel
{
- private CoinListViewModel _coinList;
+ private ReadOnlyCoinListViewModel _coinList;
private string _buildTransactionButtonText;
private bool _isMax;
private string _amount;
@@ -23,7 +23,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public SendTabViewModel(WalletViewModel walletViewModel)
: base("Send", walletViewModel)
{
- CoinList = new CoinListViewModel(Global.WalletService.Coins);
+ CoinList = new ReadOnlyCoinListViewModel(Global.WalletService.Coins);
BuildTransactionButtonText = BuildTransactionButtonTextString;
@@ -84,7 +84,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
_ignoreAmountChanges = false;
}
- public CoinListViewModel CoinList
+ public ReadOnlyCoinListViewModel CoinList
{
get { return _coinList; }
set { this.RaiseAndSetIfChanged(ref _coinList, value); }

begin implementing coinjoin.