dependency hell... pass spaghetti to ctors.
MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -90,7 +90,7 @@ namespace WalletWasabi.Fluent.ViewModels
}
else if (_walletDictionary[wallet] is ClosedWalletViewModel { IsLoggedIn: true } cwvm && wallet.State == WalletState.Started)
{
- OpenClosedWallet(uiConfig, cwvm);
+ OpenClosedWallet(config, uiConfig, cwvm);
}
}
@@ -106,7 +106,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
WalletViewModelBase vm = (wallet.State <= WalletState.Starting)
? ClosedWalletViewModel.Create(this, wallet)
- : WalletViewModel.Create(uiConfig, wallet);
+ : WalletViewModel.Create(config, uiConfig, wallet);
InsertWallet(vm);
});
@@ -145,13 +145,13 @@ namespace WalletWasabi.Fluent.ViewModels
}
}
- private void OpenClosedWallet(UiConfig uiConfig, ClosedWalletViewModel closedWalletViewModel)
+ private void OpenClosedWallet(Config config, UiConfig uiConfig, ClosedWalletViewModel closedWalletViewModel)
{
IsLoadingWallet = true;
RemoveWallet(closedWalletViewModel);
- var walletViewModelItem = OpenWallet(uiConfig, closedWalletViewModel.Wallet);
+ var walletViewModelItem = OpenWallet(config, uiConfig, closedWalletViewModel.Wallet);
if (!_walletActionsDictionary.TryGetValue(walletViewModelItem, out var actions))
{
@@ -168,14 +168,14 @@ namespace WalletWasabi.Fluent.ViewModels
IsLoadingWallet = false;
}
- private WalletViewModel OpenWallet(UiConfig uiConfig, Wallet wallet)
+ private WalletViewModel OpenWallet(Config config, UiConfig uiConfig, Wallet wallet)
{
if (_wallets.Any(x => x.Title == wallet.WalletName))
{
throw new Exception("Wallet already opened.");
}
- var walletViewModel = WalletViewModel.Create(uiConfig, wallet);
+ var walletViewModel = WalletViewModel.Create(config, uiConfig, wallet);
InsertWallet(walletViewModel);

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

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -19,7 +19,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
public partial class WalletViewModel : WalletViewModelBase
{
- protected WalletViewModel(UiConfig uiConfig, Wallet wallet) : base(wallet)
+ protected WalletViewModel(Config config, UiConfig uiConfig, Wallet wallet) : base(wallet)
{
Disposables = Disposables is null ? new CompositeDisposable() : throw new NotSupportedException($"Cannot open {GetType().Name} before closing it.");
@@ -50,7 +50,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
History = new HistoryViewModel(wallet, uiConfig);
BalanceTile = new WalletBalanceTileViewModel(wallet, balanceChanged);
BalanceChartTile = new WalletBalanceChartTileViewModel(History.Transactions);
- WalletPieChart = new WalletPieChartTileViewModel(wallet);
+ WalletPieChart = new WalletPieChartTileViewModel(wallet, config, balanceChanged);
}
private CompositeDisposable Disposables { get; set; }
@@ -84,13 +84,13 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
await History.UpdateAsync();
}
- public static WalletViewModel Create(UiConfig uiConfig, Wallet wallet)
+ public static WalletViewModel Create(Config config, UiConfig uiConfig, Wallet wallet)
{
return wallet.KeyManager.IsHardwareWallet
- ? new HardwareWalletViewModel(uiConfig, wallet)
+ ? new HardwareWalletViewModel(config, uiConfig, wallet)
: wallet.KeyManager.IsWatchOnly
- ? new WatchOnlyWalletViewModel(uiConfig, wallet)
- : new WalletViewModel(uiConfig, wallet);
+ ? new WatchOnlyWalletViewModel(config, uiConfig, wallet)
+ : new WalletViewModel(config, uiConfig, wallet);
}
}
}

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

dependency hell... pass spaghetti to ctors.