Changed ShuttingDownViewModel to a RoutableViewModel
MODIFY
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
@@ -57,8 +57,7 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
public void OnShutdownPrevented()
{
- RxApp.MainThreadScheduler.Schedule(async () =>
- await MainViewModel.Instance.CompactDialogScreen.NavigateDialogAsync(new ShuttingDownViewModel(this)));
+ RxApp.MainThreadScheduler.Schedule(() => MainViewModel.Instance.CompactDialogScreen.To(new ShuttingDownViewModel(this)));
}
public bool CanShutdown()

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/ShuttingDownViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/ShuttingDownViewModel.cs
using ReactiveUI;
-using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
-using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
+using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.Dialogs;
[NavigationMetaData(Title = "Please wait to shut down...")]
-public partial class ShuttingDownViewModel : DialogViewModelBase<Unit>
+public partial class ShuttingDownViewModel : RoutableViewModel
{
private readonly ApplicationViewModel _applicationViewModel;
- private IDisposable? _intervalDisposable;
public ShuttingDownViewModel(ApplicationViewModel applicationViewModel)
{
_applicationViewModel = applicationViewModel;
-
- NextCommand = ReactiveCommand.Create(OnNext);
+ NextCommand = CancelCommand;
}
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
- _intervalDisposable =
Observable.Interval(TimeSpan.FromSeconds(3))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ =>
{
if (_applicationViewModel.CanShutdown())
{
- Close();
+ Navigate().Clear();
_applicationViewModel.ShutDown();
}
})
.DisposeWith(disposables);
}
-
- private void OnNext()
- {
- _intervalDisposable?.Dispose();
- Close();
- }
}

Changed ShuttingDownViewModel to a RoutableViewModel