don't need to pass walletmanager
MODIFY
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
@@ -19,7 +19,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
[AutoNotify] private bool _isPasswordNeeded;
[AutoNotify] private string _errorMessage;
- public LoginViewModel(WalletManagerViewModel walletManagerViewModel, ClosedWalletViewModel closedWalletViewModel)
+ public LoginViewModel(ClosedWalletViewModel closedWalletViewModel)
{
var wallet = closedWalletViewModel.Wallet;
IsPasswordNeeded = !wallet.KeyManager.IsWatchOnly;
@@ -28,7 +28,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
_errorMessage = "";
WalletType = WalletHelpers.GetType(closedWalletViewModel.Wallet.KeyManager);
- NextCommand = ReactiveCommand.CreateFromTask(async () => await OnNextAsync(walletManagerViewModel, closedWalletViewModel, wallet));
+ NextCommand = ReactiveCommand.CreateFromTask(async () => await OnNextAsync(closedWalletViewModel, wallet));
OkCommand = ReactiveCommand.Create(OnOk);
@@ -45,7 +45,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
public ICommand ForgotPasswordCommand { get; }
- private async Task OnNextAsync(WalletManagerViewModel walletManagerViewModel, ClosedWalletViewModel closedWalletViewModel, Wallet wallet)
+ private async Task OnNextAsync(ClosedWalletViewModel closedWalletViewModel, Wallet wallet)
{
string? compatibilityPasswordUsed = null;
@@ -66,7 +66,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
if (legalResult)
{
- LoginWallet(walletManagerViewModel, closedWalletViewModel);
+ LoginWallet(closedWalletViewModel);
}
else
{
@@ -86,7 +86,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
Navigate(NavigationTarget.DialogScreen).To(new PasswordFinderIntroduceViewModel(wallet));
}
- private void LoginWallet(WalletManagerViewModel walletManagerViewModel, ClosedWalletViewModel closedWalletViewModel)
+ private void LoginWallet(ClosedWalletViewModel closedWalletViewModel)
{
closedWalletViewModel.RaisePropertyChanged(nameof(WalletViewModelBase.IsLoggedIn));
Navigate().To(closedWalletViewModel, NavigationMode.Clear);

MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -81,7 +81,7 @@ namespace WalletWasabi.Fluent.ViewModels
wallet =>
{
WalletViewModelBase vm = (wallet.State <= WalletState.Starting)
- ? ClosedWalletViewModel.Create(this, wallet)
+ ? ClosedWalletViewModel.Create(wallet)
: WalletViewModel.Create(wallet);
InsertWallet(vm);
@@ -202,7 +202,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
foreach (var wallet in Services.WalletManager.GetWallets())
{
- InsertWallet(ClosedWalletViewModel.Create(this, wallet));
+ InsertWallet(ClosedWalletViewModel.Create(wallet));
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/ClosedHardwareWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/ClosedHardwareWalletViewModel.cs
@@ -4,7 +4,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
public class ClosedHardwareWalletViewModel : ClosedWalletViewModel
{
- internal ClosedHardwareWalletViewModel(WalletManagerViewModel walletManager, Wallet wallet) : base(walletManager, wallet)
+ internal ClosedHardwareWalletViewModel(Wallet wallet) : base(wallet)
{
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWalletViewModel.cs
@@ -8,11 +8,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
public class ClosedWalletViewModel : WalletViewModelBase
{
- protected ClosedWalletViewModel(WalletManagerViewModel walletManagerViewModel, Wallet wallet)
+ protected ClosedWalletViewModel(Wallet wallet)
: base(wallet)
{
Loading = new LoadingViewModel(wallet);
- OpenCommand = ReactiveCommand.Create(() => OnOpen(walletManagerViewModel));
+ OpenCommand = ReactiveCommand.Create(OnOpen);
}
public LoadingViewModel Loading { get; }
@@ -24,11 +24,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
Loading.Activate(disposables);
}
- private void OnOpen(WalletManagerViewModel walletManagerViewModel)
+ private void OnOpen()
{
if (!Wallet.IsLoggedIn)
{
- Navigate().To(new LoginViewModel(walletManagerViewModel, this), NavigationMode.Clear);
+ Navigate().To(new LoginViewModel(this), NavigationMode.Clear);
}
else
{
@@ -36,13 +36,13 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
}
}
- public static WalletViewModelBase Create(WalletManagerViewModel walletManager, Wallet wallet)
+ public static WalletViewModelBase Create(Wallet wallet)
{
return wallet.KeyManager.IsHardwareWallet
- ? new ClosedHardwareWalletViewModel(walletManager, wallet)
+ ? new ClosedHardwareWalletViewModel(wallet)
: wallet.KeyManager.IsWatchOnly
- ? new ClosedWatchOnlyWalletViewModel(walletManager, wallet)
- : new ClosedWalletViewModel(walletManager, wallet);
+ ? new ClosedWatchOnlyWalletViewModel(wallet)
+ : new ClosedWalletViewModel(wallet);
}
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWatchOnlyWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/ClosedWatchOnlyWalletViewModel.cs
@@ -4,7 +4,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
public class ClosedWatchOnlyWalletViewModel : ClosedWalletViewModel
{
- internal ClosedWatchOnlyWalletViewModel(WalletManagerViewModel walletManager, Wallet wallet) : base(walletManager, wallet)
+ internal ClosedWatchOnlyWalletViewModel(Wallet wallet) : base(wallet)
{
}
}

don't need to pass walletmanager