simple navigation to and from dialogs.
MODIFY
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
@@ -55,13 +55,16 @@ namespace WalletWasabi.Fluent.ViewModels
NavigationTarget.DialogScreen,
"Type the password of the wallet and click Continue.");
- NavigateTo(enterPassword, NavigationTarget.DialogScreen);
- var result = await enterPassword.GetDialogResultAsync();
+ string? result = null;
+
+ using (NavigateTo(enterPassword, NavigationTarget.DialogScreen))
+ {
+ result = await enterPassword.GetDialogResultAsync();
+ }
if (result is { } password)
{
- GoBack();
IsBusy = true;
var (km, mnemonic) = await Task.Run(
@@ -80,10 +83,6 @@ namespace WalletWasabi.Fluent.ViewModels
IsBusy = false;
}
- else
- {
- GoBack();
- }
});
this.ValidateProperty(x => x.WalletName, errors => ValidateWalletName(errors, walletManager, WalletName));

MODIFY
WalletWasabi.Fluent/ViewModels/RoutableViewModel.cs
WalletWasabi.Fluent/ViewModels/RoutableViewModel.cs
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reactive.Disposables;
using System.Windows.Input;
using ReactiveUI;
using WalletWasabi.Fluent.ViewModels.Dialogs;
@@ -47,7 +48,7 @@ namespace WalletWasabi.Fluent.ViewModels
public ICommand CancelCommand { get; protected set; }
- public void NavigateTo(RoutableViewModel viewModel, NavigationTarget navigationTarget, bool resetNavigation = false)
+ public IDisposable NavigateTo(RoutableViewModel viewModel, NavigationTarget navigationTarget, bool resetNavigation = false)
{
switch (navigationTarget)
{
@@ -74,6 +75,8 @@ namespace WalletWasabi.Fluent.ViewModels
default:
break;
}
+
+ return Disposable.Create(()=>GoBack());
}
private void NavigateToHomeScreen(RoutableViewModel viewModel, bool resetNavigation)

simple navigation to and from dialogs.