Implements Wallets Explorer
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml.cs
@@ -5,6 +5,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public class WalletExplorerView : UserControl
{
+ public WalletExplorerView()
+ {
+ InitializeComponent();
+ }
+
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
using AvalonStudio.MVVM;
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Composition;
using System.Text;
+using ReactiveUI;
+using WalletWasabi.Gui.ViewModels;
+using System.Linq;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
[Export(typeof(IExtension))]
+ [Export]
[ExportToolControl]
[Shared]
public class WalletExplorerViewModel : ToolViewModel, IExtension
@@ -17,6 +22,30 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public WalletExplorerViewModel()
{
Title = "Wallet Explorer";
+
+ _wallets = new ObservableCollection<WalletViewModel>();
+ }
+
+ private ObservableCollection<WalletViewModel> _wallets;
+ public ObservableCollection<WalletViewModel> Wallets
+ {
+ get { return _wallets;}
+ set { this.RaiseAndSetIfChanged(ref _wallets, value); }
+ }
+
+ private DocumentTabViewModel _selectedItem;
+ public DocumentTabViewModel SelectedItem
+ {
+ get { return _selectedItem; }
+ set { this.RaiseAndSetIfChanged(ref _selectedItem, value); }
+ }
+
+ internal void OpenWallet(string walletName)
+ {
+ if(_wallets.Any(x=>x.Title == walletName))
+ return;
+
+ _wallets.Add(new WalletViewModel(walletName));
}
}
}

ADD
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
+using System;
+using System.Collections.ObjectModel;
+using System.Composition;
+using AvalonStudio.Extensibility;
+using AvalonStudio.Shell;
+using ReactiveUI;
+using WalletWasabi.Gui.ViewModels;
+
+namespace WalletWasabi.Gui.Controls.WalletExplorer
+{
+ public class WalletViewModel : DocumentTabViewModel
+ {
+ 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));
+ }
+
+ public string Name { get; }
+
+ private ObservableCollection<DocumentTabViewModel> _actions;
+ public ObservableCollection<DocumentTabViewModel> Actions
+ {
+ get { return _actions; }
+ set { this.RaiseAndSetIfChanged(ref _actions, value); }
+ }
+ }
+
+ public class WalletActionViewModel : DocumentTabViewModel
+ {
+ public WalletViewModel Wallet { get; }
+
+ public WalletActionViewModel(string title, WalletViewModel walletViewModel)
+ : base(title)
+ {
+ Wallet = walletViewModel;
+ DoItCommand = ReactiveCommand.Create(DisplayActionTab);
+ }
+
+ public ReactiveCommand DoItCommand { get; }
+
+ public void DisplayActionTab()
+ {
+ IoC.Get<IShell>().AddDocument(this);
+ }
+ }
+
+ public class SendActionViewModel : WalletActionViewModel
+ {
+ public SendActionViewModel(WalletViewModel walletViewModel)
+ : base("Send", walletViewModel){}
+ }
+
+ public class ReceiveActionViewModel : WalletActionViewModel
+ {
+ public ReceiveActionViewModel(WalletViewModel walletViewModel)
+ : base("Receive", walletViewModel){}
+ }
+
+ public class HistoryActionViewModel : WalletActionViewModel
+ {
+ public HistoryActionViewModel(WalletViewModel walletViewModel)
+ : base("History", walletViewModel){}
+ }
+
+ public class CoinJoinActionViewModel : WalletActionViewModel
+ {
+ public CoinJoinActionViewModel(WalletViewModel walletViewModel)
+ : base("CoinJoin", walletViewModel){}
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -11,6 +11,7 @@ using WalletWasabi.KeyManagement;
using WalletWasabi.Logging;
using WalletWasabi.Services;
using System.Threading.Tasks;
+using WalletWasabi.Gui.Controls.WalletExplorer;
namespace WalletWasabi.Gui.Tabs.WalletManager
{
@@ -118,7 +119,8 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
await Global.InitializeWalletServiceAsync(keyManager);
// Successffully initialized.
IoC.Get<IShell>().RemoveDocument(Owner);
- // ToDo: Open Wallet Explorer tabs
+ // Open Wallet Explorer tabs
+ IoC.Get<WalletExplorerViewModel>().OpenWallet(SelectedWallet);
}
catch (Exception ex)
{

MODIFY
WalletWasabi.Gui/ViewModels/DocumentTabViewModel.cs
WalletWasabi.Gui/ViewModels/DocumentTabViewModel.cs
@@ -5,7 +5,7 @@ using Dock.Model;
namespace WalletWasabi.Gui.ViewModels
{
- internal abstract class DocumentTabViewModel : ViewModelBase, IDocumentTabViewModel
+ public abstract class DocumentTabViewModel : ViewModelBase, IDocumentTabViewModel
{
public DocumentTabViewModel(string title)
{

Implements Wallets Explorer