Show when start from desktop
MODIFY
WalletWasabi.Fluent.Desktop/Program.cs
WalletWasabi.Fluent.Desktop/Program.cs
@@ -72,7 +72,7 @@ namespace WalletWasabi.Fluent.Desktop
// TODO only required due to statusbar vm... to be removed.
Locator.CurrentMutable.RegisterConstant(Global);
- Services.Initialize(Global);
+ Services.Initialize(Global, singleInstanceChecker);
Logger.LogSoftwareStarted("Wasabi GUI");
BuildAvaloniaApp()

MODIFY
WalletWasabi.Fluent/App.axaml.cs
WalletWasabi.Fluent/App.axaml.cs
@@ -74,6 +74,14 @@ namespace WalletWasabi.Fluent
}
base.OnFrameworkInitializationCompleted();
+
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ Services.SingleInstanceChecker.OtherInstanceStarted += (sender, args) =>
+ {
+ MainViewModel.Instance!.WindowState = WindowState.Normal; // Todo: Unhide, Show, BringToFront?
+ };
+ }
}
private void DesktopOnShutdownRequested(object? sender, ShutdownRequestedEventArgs e)

MODIFY
WalletWasabi.Fluent/Services.cs
WalletWasabi.Fluent/Services.cs
@@ -33,13 +33,15 @@ namespace WalletWasabi.Fluent
public static UiConfig UiConfig { get; private set; } = null!;
+ public static SingleInstanceChecker SingleInstanceChecker { get; private set; } = null!;
+
public static bool IsInitialized { get; private set; }
/// <summary>
/// Initializes global services used by fluent project.
/// </summary>
/// <param name="global">The global instance.</param>
- public static void Initialize(Global global)
+ public static void Initialize(Global global, SingleInstanceChecker singleInstanceChecker)
{
Guard.NotNull(nameof(global.DataDir), global.DataDir);
Guard.NotNull(nameof(global.TorSettings), global.TorSettings);
@@ -63,6 +65,7 @@ namespace WalletWasabi.Fluent
TransactionBroadcaster = global.TransactionBroadcaster;
HostedServices = global.HostedServices;
UiConfig = global.UiConfig;
+ SingleInstanceChecker = singleInstanceChecker;
IsInitialized = true;
}

Show when start from desktop