Remove AvaloniaExtensions altogether
DELETE
WalletWasabi.Gui/Helpers/AvaloniaExtensions.cs
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.Text;
-using AvalonStudio.Shell;
-using Avalonia.Controls;
-
-namespace Avalonia
-{
- public static class AvaloniaExtensions
- {
- public static void AddOrReplace(this IResourceDictionary resources, object key, object value)
- {
- if (resources.TryGetResource(key.ToString(), out _))
- resources[key] = value;
- else
- resources.Add(key, value);
- }
- }
-}

MODIFY
WalletWasabi.Gui/MainWindow.xaml.cs
WalletWasabi.Gui/MainWindow.xaml.cs
@@ -6,6 +6,7 @@ using AvalonStudio.Extensibility;
using AvalonStudio.Extensibility.Theme;
using AvalonStudio.Shell;
using AvalonStudio.Shell.Controls;
+using NBitcoin;
using System;
using System.ComponentModel;
using System.IO;
@@ -50,8 +51,11 @@ namespace WalletWasabi.Gui
protected override void OnDataContextEndUpdate()
{
- if (Global.Instance == null)
+ if (Global.Instance is null)
+ {
return;
+ }
+
Application.Current.Resources.AddOrReplace(Global.GlobalResourceKey, Global.Instance);
Application.Current.Resources.AddOrReplace(Global.ConfigResourceKey, Global.Instance.Config);
Application.Current.Resources.AddOrReplace(Global.UiConfigResourceKey, Global.Instance.UiConfig);

Remove AvaloniaExtensions altogether