Open wallet tabs when wallet is loaded
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -8,6 +8,7 @@ using System.Text;
using ReactiveUI;
using WalletWasabi.Gui.ViewModels;
using System.Linq;
+using AvalonStudio.Shell;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -27,6 +28,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
private ObservableCollection<WalletViewModel> _wallets;
+
public ObservableCollection<WalletViewModel> Wallets
{
get { return _wallets; }
@@ -34,6 +36,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
private DocumentTabViewModel _selectedItem;
+
public DocumentTabViewModel SelectedItem
{
get { return _selectedItem; }
@@ -45,7 +48,14 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
if (_wallets.Any(x => x.Title == walletName))
return;
- _wallets.Add(new WalletViewModel(walletName));
+ WalletViewModel walletViewModel = new WalletViewModel(walletName);
+ _wallets.Add(walletViewModel);
+
+ IoC.Get<IShell>().AddOrSelectDocument<SendActionViewModel>(new SendActionViewModel(walletViewModel));
+ IoC.Get<IShell>().AddOrSelectDocument<ReceiveActionViewModel>(new ReceiveActionViewModel(walletViewModel));
+ IoC.Get<IShell>().AddOrSelectDocument<CoinJoinActionViewModel>(new CoinJoinActionViewModel(walletViewModel));
+ IoC.Get<IShell>().AddOrSelectDocument<HistoryActionViewModel>(new HistoryActionViewModel(walletViewModel));
+ IoC.Get<IShell>().SelectedDocument = IoC.Get<IShell>().Documents.FirstOrDefault(x => x is ReceiveActionViewModel);
}
}
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -13,16 +13,19 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public WalletViewModel(string name)
: base(name)
{
- _actions = new ObservableCollection<DocumentTabViewModel>();
- _actions.Add(new SendActionViewModel(this));
- _actions.Add(new ReceiveActionViewModel(this));
- _actions.Add(new CoinJoinActionViewModel(this));
- _actions.Add(new HistoryActionViewModel(this));
+ _actions = new ObservableCollection<DocumentTabViewModel>
+ {
+ new SendActionViewModel(this),
+ new ReceiveActionViewModel(this),
+ new CoinJoinActionViewModel(this),
+ new HistoryActionViewModel(this)
+ };
}
public string Name { get; }
private ObservableCollection<DocumentTabViewModel> _actions;
+
public ObservableCollection<DocumentTabViewModel> Actions
{
get { return _actions; }
@@ -45,7 +48,22 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public void DisplayActionTab()
{
- IoC.Get<IShell>().AddDocument(this);
+ if (Title == "Send")
+ {
+ IoC.Get<IShell>().AddOrSelectDocument<SendActionViewModel>(this);
+ }
+ else if (Title == "Receive")
+ {
+ IoC.Get<IShell>().AddOrSelectDocument<ReceiveActionViewModel>(this);
+ }
+ else if (Title == "CoinJoin")
+ {
+ IoC.Get<IShell>().AddOrSelectDocument<CoinJoinActionViewModel>(this);
+ }
+ else if (Title == "History")
+ {
+ IoC.Get<IShell>().AddOrSelectDocument<HistoryActionViewModel>(this);
+ }
}
}

Open wallet tabs when wallet is loaded