Wasabi is shutting down dialog
MODIFY
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
WalletWasabi.Fluent/ViewModels/ApplicationViewModel.cs
@@ -25,7 +25,7 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
{
_mainWindowService = mainWindowService;
- QuitCommand = ReactiveCommand.Create(_mainWindowService.Shutdown);
+ QuitCommand = ReactiveCommand.Create(ShutDown);
ShowHideCommand = ReactiveCommand.Create(() =>
{
@@ -73,13 +73,12 @@ public partial class ApplicationViewModel : ViewModelBase, ICanShutdownProvider
public ICommand QuitCommand { get; }
+ public void ShutDown() => _mainWindowService.Shutdown();
+
public void OnShutdownPrevented()
{
RxApp.MainThreadScheduler.Schedule(async () =>
- await MainViewModel.Instance.CompactDialogScreen.NavigateDialogAsync(new ShowErrorDialogViewModel(
- "Wasabi is currently anonymising your wallet. Please try again in a few minutes.",
- "Warning",
- "Unable to close right now")));
+ await MainViewModel.Instance.CompactDialogScreen.NavigateDialogAsync(new ShuttingDownViewModel(this)));
}
public bool CanShutdown()

ADD
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;
+
+namespace WalletWasabi.Fluent.ViewModels.Dialogs;
+
+public class ShuttingDownViewModel : DialogViewModelBase<Unit>
+{
+ private readonly ApplicationViewModel _applicationViewModel;
+ private string _title;
+
+ public ShuttingDownViewModel(ApplicationViewModel applicationViewModel)
+ {
+ _title = "Wasabi is shutting down...";
+
+ CancelCommand = ReactiveCommand.Create(() => Close());
+ _applicationViewModel = applicationViewModel;
+ }
+
+ public override string Title
+ {
+ get => _title;
+ protected set => this.RaiseAndSetIfChanged(ref _title, value);
+ }
+
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ Observable.Interval(TimeSpan.FromSeconds(3))
+ .Subscribe(_ =>
+ {
+ if (_applicationViewModel.CanShutdown())
+ {
+ Close();
+ _applicationViewModel.ShutDown();
+ }
+ })
+ .DisposeWith(disposables);
+ }
+}

ADD
WalletWasabi.Fluent/Views/Dialogs/ShuttingdownDialogView.axaml
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:c="using:WalletWasabi.Fluent.Controls"
+ xmlns:dialog="using:WalletWasabi.Fluent.ViewModels.Dialogs"
+ mc:Ignorable="d" d:DesignWidth="428" d:DesignHeight="371"
+ x:DataType="dialog:ShuttingDownViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Dialogs.ShuttingDownView">
+ <c:ContentArea Title="{Binding Title}"
+ ScrollViewer.VerticalScrollBarVisibility="Disabled">
+ <DockPanel VerticalAlignment="Center">
+ <TextBlock Text="This may take a few minutes."
+ DockPanel.Dock="Bottom" TextAlignment="Center" TextWrapping="Wrap" MaxWidth="500" Margin="20 0" />
+ <Viewbox MaxHeight="100" Margin="40">
+ <c:ProgressRing IsIndeterminate="True" Height="100" Width="100" />
+ </Viewbox>
+ </DockPanel>
+ </c:ContentArea>
+</UserControl>

ADD
WalletWasabi.Fluent/Views/Dialogs/ShuttingdownDialogView.axaml.cs
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace WalletWasabi.Fluent.Views.Dialogs;
+
+public class ShuttingDownView : UserControl
+{
+ public ShuttingDownView()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+}

Wasabi is shutting down dialog