remove walletmanager from walletviewmodelbase.
MODIFY
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
@@ -5,7 +5,6 @@ using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.Fluent.ViewModels.Wallets;
using WalletWasabi.Userfacing;
-using WalletWasabi.Wallets;
namespace WalletWasabi.Fluent.ViewModels.Login
{
@@ -16,7 +15,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
[AutoNotify] private bool _isPasswordNeeded;
[AutoNotify] private string _walletName;
- public LoginViewModel(WalletViewModelBase walletViewModelBase, WalletManager walletManager)
+ public LoginViewModel(WalletViewModelBase walletViewModelBase)
{
Title = "Login";
KeyManager = walletViewModelBase.Wallet.KeyManager;

MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -57,7 +57,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
WalletViewModelBase vm = (wallet.State <= WalletState.Starting)
? ClosedWalletViewModel.Create(walletManager, wallet)
- : WalletViewModel.Create(uiConfig, wallet, walletManager);
+ : WalletViewModel.Create(uiConfig, wallet);
InsertWallet(vm);
});
@@ -88,7 +88,7 @@ namespace WalletWasabi.Fluent.ViewModels
throw new Exception("Wallet already opened.");
}
- var walletViewModel = WalletViewModel.Create(uiConfig, wallet, walletManager);
+ var walletViewModel = WalletViewModel.Create(uiConfig, wallet);
InsertWallet(walletViewModel);

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWalletViewModel.cs
@@ -17,7 +17,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
[AutoNotify] private ObservableCollection<NavBarItemViewModel> _items;
- protected ClosedWalletViewModel(WalletManager walletManager, Wallet wallet) : base(wallet, walletManager)
+ protected ClosedWalletViewModel(WalletManager walletManager, Wallet wallet) : base(wallet)
{
_items = new ObservableCollection<NavBarItemViewModel>();

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/HardwareWallet/HardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/HardwareWallet/HardwareWalletViewModel.cs
@@ -5,7 +5,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.HardwareWallet
{
public class HardwareWalletViewModel : WalletViewModel
{
- internal HardwareWalletViewModel(UiConfig uiConfig, Wallet wallet, WalletManager walletManager) : base(uiConfig, wallet, walletManager)
+ internal HardwareWalletViewModel(UiConfig uiConfig, Wallet wallet) : base(uiConfig, wallet)
{
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -19,7 +19,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
[AutoNotify] private ObservableCollection<ViewModelBase> _actions;
- protected WalletViewModel(UiConfig uiConfig, Wallet wallet, WalletManager walletManager) : base(wallet, walletManager)
+ protected WalletViewModel(UiConfig uiConfig, Wallet wallet) : base(wallet)
{
Disposables = Disposables is null ? new CompositeDisposable() : throw new NotSupportedException($"Cannot open {GetType().Name} before closing it.");
@@ -63,13 +63,13 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
public override string IconName => "web_asset_regular";
- public static WalletViewModel Create(UiConfig uiConfig, Wallet wallet, WalletManager walletManager)
+ public static WalletViewModel Create(UiConfig uiConfig, Wallet wallet)
{
return wallet.KeyManager.IsHardwareWallet
- ? new HardwareWalletViewModel(uiConfig, wallet, walletManager)
+ ? new HardwareWalletViewModel(uiConfig, wallet)
: wallet.KeyManager.IsWatchOnly
- ? new WatchOnlyWalletViewModel(uiConfig, wallet, walletManager)
- : new WalletViewModel(uiConfig, wallet, walletManager);
+ ? new WatchOnlyWalletViewModel(uiConfig, wallet)
+ : new WalletViewModel(uiConfig, wallet);
}
public void OpenWalletTabs()

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModelBase.cs
@@ -17,7 +17,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
private CompositeDisposable? _disposables;
private bool _disposedValue;
- protected WalletViewModelBase(Wallet wallet, WalletManager walletManager)
+ protected WalletViewModelBase(Wallet wallet)
{
Wallet = Guard.NotNull(nameof(wallet), wallet);
@@ -39,7 +39,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
if (!Wallet.IsLoggedIn)
{
- Navigate().To(new LoginViewModel(this, walletManager));
+ Navigate().To(new LoginViewModel(this));
}
else
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WatchOnlyWallet/WatchOnlyWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WatchOnlyWallet/WatchOnlyWalletViewModel.cs
@@ -5,7 +5,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.WatchOnlyWallet
{
public class WatchOnlyWalletViewModel : WalletViewModel
{
- internal WatchOnlyWalletViewModel(UiConfig uiConfig, Wallet wallet, WalletManager walletManager) : base(uiConfig, wallet, walletManager)
+ internal WatchOnlyWalletViewModel(UiConfig uiConfig, Wallet wallet) : base(uiConfig, wallet)
{
}
}

remove walletmanager from walletviewmodelbase.