public ApplicationViewModel() { QuitCommand = ReactiveCommand.CreateFromTask(async() => { if (CanShutdown()) { if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime) { desktopLifetime.Shutdown(); } } else { // Show the window if it was hidden. ShowRequested?.Invoke(this, EventArgs.Empty); await MainViewModel.Instance !.CompactDialogScreen.NavigateDialogAsync(new Dialogs.ShowErrorDialogViewModel( "Wasabi is currently anonymising your wallet. Please try again in a few seconds.", "Warning", "Unable to close")); } }); ShowCommand = ReactiveCommand.Create(() => ShowRequested?.Invoke(this, EventArgs.Empty)); }
public ApplicationViewModel() { QuitCommand = ReactiveCommand.CreateFromTask(async() => { if (CanShutdown()) { if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime) { desktopLifetime.Shutdown(); } else { await MainViewModel.Instance !.CompactDialogScreen.NavigateDialogAsync(new Dialogs.ShowErrorDialogViewModel( "Wasabi is currently anonymising your wallet. Please try again in a few seconds.", "Warning", "Unable to close")); } } }); }