Pass UiConfig via constructor
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -157,7 +157,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Label = txr.Label,
BlockHeight = txr.Height.Type == HeightType.Chain ? txr.Height.Value : 0,
TransactionId = txr.TransactionId.ToString()
- }).Select(ti => new TransactionViewModel(ti));
+ }).Select(ti => new TransactionViewModel(ti, Global.UiConfig));
Transactions = new ObservableCollection<TransactionViewModel>(trs);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionInfoTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionInfoTabViewModel.cs
@@ -10,20 +10,19 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public class TransactionInfoTabViewModel : WasabiDocumentTabViewModel
{
- public TransactionInfoTabViewModel(TransactionDetailsViewModel transaction) : base("")
+ public TransactionInfoTabViewModel(TransactionDetailsViewModel transaction, UiConfig uiConfig) : base("")
{
- Global = Locator.Current.GetService<Global>();
Transaction = transaction;
+ UiConfig = uiConfig;
Title = $"Transaction ({transaction.TransactionId[0..10]}) Details";
}
- protected Global Global { get; }
-
public TransactionDetailsViewModel Transaction { get; }
+ public UiConfig UiConfig { get; }
public override void OnOpen(CompositeDisposable disposables)
{
- Global.UiConfig.WhenAnyValue(x => x.LurkingWifeMode)
+ UiConfig.WhenAnyValue(x => x.LurkingWifeMode)
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x => Transaction.RaisePropertyChanged(nameof(Transaction.TransactionId)))
.DisposeWith(disposables);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewModel.cs
@@ -22,7 +22,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private bool _clipboardNotificationVisible;
private double _clipboardNotificationOpacity;
- public TransactionViewModel(TransactionDetailsViewModel model)
+ public TransactionViewModel(TransactionDetailsViewModel model, UiConfig uiConfig)
{
TransactionDetails = model;
ClipboardNotificationVisible = false;
@@ -38,7 +38,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
if (transactionInfo is null)
{
- transactionInfo = new TransactionInfoTabViewModel(TransactionDetails);
+ transactionInfo = new TransactionInfoTabViewModel(TransactionDetails, uiConfig);
shell.AddDocument(transactionInfo);
}

Pass UiConfig via constructor