Remove Load Wallet option after selecting one
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletSuccessViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/GenerateWalletSuccessViewModel.cs
@@ -14,7 +14,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
ConfirmCommand = ReactiveCommand.Create(() =>
{
- owner.SelectedCategory = owner.LoadWalletCategory;
+ owner.SelectLoadWallet();
});
}

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -17,9 +17,11 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
private ObservableCollection<string> _wallets;
private string _selectedWallet;
private bool _isSelectedWallet;
+ private WalletManagerViewModel _owner;
- public LoadWalletViewModel() : base("Load Wallet")
+ public LoadWalletViewModel(WalletManagerViewModel owner) : base("Load Wallet")
{
+ _owner = owner;
_wallets = new ObservableCollection<string>();
this.WhenAnyValue(x => x.SelectedWallet).Subscribe(SelectedWallet => IsSelectedWallet = !string.IsNullOrEmpty(SelectedWallet));
LoadCommand = ReactiveCommand.Create(
@@ -71,6 +73,8 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
// Implement the logic here
+
+ _owner.RemoveLoadWalletOption();
}
}
}

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
@@ -52,7 +52,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
var mnemonic = new Mnemonic(MnemonicWords);
KeyManager.Recover(mnemonic, Password, walletFilePath);
- owner.SelectedCategory = owner.LoadWalletCategory;
+ owner.SelectLoadWallet();
}
catch (Exception ex)
{

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/WalletManagerViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/WalletManagerViewModel.cs
@@ -14,13 +14,11 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
public WalletManagerViewModel() : base("Wallet Manager")
{
- LoadWalletCategory = new LoadWalletViewModel();
-
Categories = new ObservableCollection<CategoryViewModel>
{
new GenerateWalletViewModel(this),
new RecoverWalletViewModel(this),
- LoadWalletCategory
+ new LoadWalletViewModel(this)
};
SelectedCategory = Categories.FirstOrDefault();
@@ -33,8 +31,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
});
}
- public LoadWalletViewModel LoadWalletCategory { get; }
-
public ObservableCollection<CategoryViewModel> Categories
{
get { return _categories; }
@@ -67,5 +63,11 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
get { return _currentView; }
set { this.RaiseAndSetIfChanged(ref _currentView, value); }
}
+
+ internal void RemoveLoadWalletOption()
+ {
+ SelectGenerateWallet();
+ Categories.Remove(Categories.First(x=>x is LoadWalletViewModel));
+ }
}
}

Remove Load Wallet option after selecting one