do not store KeyManager reference
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddedWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddedWalletPageViewModel.cs
@@ -14,7 +14,8 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
public AddedWalletPageViewModel(WalletManager walletManager, KeyManager keyManager)
{
- KeyManager = keyManager;
+ WalletIcon = keyManager.Icon;
+ IsHardwareWallet = keyManager.IsHardwareWallet;
WalletName = keyManager.WalletName;
NextCommand = ReactiveCommand.Create(
@@ -36,7 +37,9 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
});
}
- public KeyManager KeyManager { get; }
+ public string? WalletIcon { get; }
+
+ public bool IsHardwareWallet { get; }
public string WalletName { get; }
}

MODIFY
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
WalletWasabi.Fluent/ViewModels/Login/LoginViewModel.cs
@@ -29,9 +29,10 @@ namespace WalletWasabi.Fluent.ViewModels.Login
var wallet = _closedWalletViewModel.Wallet;
var legalChecker = walletManagerViewModel.LegalChecker;
- KeyManager = wallet.KeyManager;
- IsPasswordNeeded = !KeyManager.IsWatchOnly;
+ IsPasswordNeeded = !wallet.KeyManager.IsWatchOnly;
+ WalletIcon = wallet.KeyManager.Icon;
+ IsHardwareWallet = wallet.KeyManager.IsHardwareWallet;
_walletName = wallet.WalletName;
_password = "";
@@ -44,7 +45,7 @@ namespace WalletWasabi.Fluent.ViewModels.Login
return false;
}
- if (PasswordHelper.TryPassword(KeyManager, Password, out var compatibilityPasswordUsed))
+ if (PasswordHelper.TryPassword(wallet.KeyManager, Password, out var compatibilityPasswordUsed))
{
if (compatibilityPasswordUsed is { })
{
@@ -94,7 +95,9 @@ namespace WalletWasabi.Fluent.ViewModels.Login
public ICommand ForgotPasswordCommand { get; }
- public KeyManager KeyManager { get; }
+ public string? WalletIcon { get; }
+
+ public bool IsHardwareWallet { get; }
private async Task LoginWalletAsync()
{

MODIFY
WalletWasabi.Fluent/Views/AddWallet/AddedWalletPageView.axaml
WalletWasabi.Fluent/Views/AddWallet/AddedWalletPageView.axaml
<TextBlock Text=" was added to Wasabi." />
</StackPanel>
<Viewbox MaxHeight="200">
- <Image DataContext="{Binding KeyManager}">
+ <Image>
<Image.Source>
<MultiBinding Converter="{x:Static conv:WalletIconConverter.TypesToImage}">
- <Binding Path="Icon" Converter="{x:Static conv:WalletIconConverter.StringToType}" />
+ <Binding Path="WalletIcon" Converter="{x:Static conv:WalletIconConverter.StringToType}" />
<Binding Path="IsHardwareWallet" Converter="{x:Static conv:WalletIconConverter.BoolToType}" />
</MultiBinding>
</Image.Source>

MODIFY
WalletWasabi.Fluent/Views/Login/LoginView.axaml
WalletWasabi.Fluent/Views/Login/LoginView.axaml
<!-- Icon -->
<Viewbox MaxHeight="200">
- <Image DataContext="{Binding KeyManager}">
+ <Image>
<Image.Source>
<MultiBinding Converter="{x:Static conv:WalletIconConverter.TypesToImage}">
- <Binding Path="Icon" Converter="{x:Static conv:WalletIconConverter.StringToType}" />
+ <Binding Path="WalletIcon" Converter="{x:Static conv:WalletIconConverter.StringToType}" />
<Binding Path="IsHardwareWallet" Converter="{x:Static conv:WalletIconConverter.BoolToType}" />
</MultiBinding>
</Image.Source>

do not store KeyManager reference