ApplicationStateManager handles StandardMode shutdown requests.
MODIFY
WalletWasabi.Fluent/Providers/IMainWindowService.cs
WalletWasabi.Fluent/Providers/IMainWindowService.cs
@@ -5,4 +5,6 @@ public interface IMainWindowService
void Show();
void Close();
+
+ void Shutdown();
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
@@ -24,20 +24,7 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
{
_mainWindowService = mainWindowService;
- this.WhenAnyValue(x => x.IsMainWindowShown)
- .Where(x => x == false)
- .Subscribe(async x =>
- {
- if (!Services.UiConfig.HideOnClose && Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime
- {
- MainWindow: null
- })
- {
- DoQuit();
- }
- });
-
- QuitCommand = ReactiveCommand.Create(DoQuit);
+ QuitCommand = ReactiveCommand.Create(_mainWindowService.Shutdown);
ShowCommand = ReactiveCommand.Create(() =>
{
@@ -78,37 +65,6 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
}
}
- private void DoQuit()
- {
- if (CanShutdown())
- {
- if (Application.Current?.ApplicationLifetime is IControlledApplicationLifetime lifetime)
- {
- lifetime.Shutdown();
- }
- }
- else
- {
- _mainWindowService.Show();
- IsMainWindowShown = true;
-
- OnClosePrevented();
- }
- }
-
- public void OnClosePrevented()
- {
- _mainWindowService.Show();
-
- RxApp.MainThreadScheduler.Schedule(async () =>
- {
- await MainViewModel.Instance.CompactDialogScreen.NavigateDialogAsync(new Dialogs.ShowErrorDialogViewModel(
- "Wasabi is currently anonymising your wallet. Please try again in a few minutes.",
- "Warning",
- "Unable to close right now"));
- });
- }
-
public WindowIcon TrayIcon { get; }
public ICommand AboutCommand { get; }
public ICommand ShowCommand { get; }

MODIFY
WalletWasabi.Fluent/Views/MainWindow.axaml.cs
WalletWasabi.Fluent/Views/MainWindow.axaml.cs
@@ -21,19 +21,4 @@ public class MainWindow : Window
this.AttachDevTools();
#endif
}
-
- protected override void OnClosing(CancelEventArgs e)
- {
- base.OnClosing(e);
-
- if (!Services.UiConfig.HideOnClose && Application.Current?.DataContext is ApplicationViewModel avm)
- {
- e.Cancel = !avm.CanShutdown();
-
- if (e.Cancel)
- {
- avm.OnClosePrevented();
- }
- }
- }
}

ApplicationStateManager handles StandardMode shutdown requests.