pop window when shutdown prevented and it is minimized.
MODIFY
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
-using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Windows.Input;
using Avalonia.Controls;
@@ -7,7 +6,6 @@ using WalletWasabi.Fluent.Helpers;
using WalletWasabi.Fluent.Providers;
using WalletWasabi.Fluent.ViewModels.Dialogs;
using WalletWasabi.Fluent.ViewModels.HelpAndSupport;
-using WalletWasabi.Fluent.ViewModels.Navigation;
using WalletWasabi.WabiSabi.Client;
namespace WalletWasabi.Fluent.ViewModels;
@@ -57,7 +55,8 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
public void OnShutdownPrevented()
{
- RxApp.MainThreadScheduler.Schedule(() => MainViewModel.Instance.CompactDialogScreen.To(new ShuttingDownViewModel(this)));
+ MainViewModel.Instance.ApplyUiConfigWindowSate(); // Will pop the window if it was minimized.
+ MainViewModel.Instance.CompactDialogScreen.To(new ShuttingDownViewModel(this));
}
public bool CanShutdown()

MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -41,7 +41,7 @@ public partial class MainViewModel : ViewModelBase
public MainViewModel()
{
- _windowState = (WindowState)Enum.Parse(typeof(WindowState), Services.UiConfig.WindowState);
+ ApplyUiConfigWindowSate();
_dialogScreen = new DialogScreenViewModel();
@@ -72,6 +72,7 @@ public partial class MainViewModel : ViewModelBase
RxApp.MainThreadScheduler.Schedule(async () => await _navBar.InitialiseAsync());
this.WhenAnyValue(x => x.WindowState)
+ .Where(state => state != WindowState.Minimized)
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(state => Services.UiConfig.WindowState = state.ToString());
@@ -252,4 +253,9 @@ public partial class MainViewModel : ViewModelBase
OpenTorLogsViewModel.RegisterLazy(() => new OpenTorLogsViewModel());
OpenConfigFileViewModel.RegisterLazy(() => new OpenConfigFileViewModel());
}
+
+ public void ApplyUiConfigWindowSate()
+ {
+ WindowState = (WindowState)Enum.Parse(typeof(WindowState), Services.UiConfig.WindowState);
+ }
}

pop window when shutdown prevented and it is minimized.