fix dialogs.
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
@@ -47,7 +47,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
var result = await NavigateDialog(new EnterPasswordViewModel(
navigationState,
- NavigationTarget.DialogScreen,
"Type the password of the wallet and click Continue."));
if (result is { } password)

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/ConfirmRecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/ConfirmRecoveryWordsViewModel.cs
@@ -32,11 +32,11 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
() =>
{
walletManager.AddWallet(keyManager);
- ClearNavigation(NavigationTarget.DialogScreen);
+ ClearNavigation();
},
finishCommandCanExecute);
- CancelCommand = ReactiveCommand.Create(() => ClearNavigation(NavigationTarget.DialogScreen));
+ CancelCommand = ReactiveCommand.Create(() => ClearNavigation());
confirmationWordsSourceList
.Connect()

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -58,7 +58,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
AdvancedOptionsInteraction.RegisterHandler(
async interaction =>
interaction.SetOutput(
- await new AdvancedRecoveryOptionsViewModel(navigationState, NavigationTarget.DialogHost, interaction.Input).ShowDialogAsync()));
+ await new AdvancedRecoveryOptionsViewModel(navigationState, interaction.Input).ShowDialogAsync()));
AdvancedRecoveryOptionsDialogCommand = ReactiveCommand.CreateFromTask(
async () =>
@@ -84,7 +84,6 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
var result = await NavigateDialog(
new EnterPasswordViewModel(
navigationState,
- NavigationTarget.DialogScreen,
"Type the password of the wallet to be able to recover and click Continue."));
if (result is { } password)
@@ -113,7 +112,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
}
finally
{
- ClearNavigation(NavigationTarget.DialogScreen);
+ ClearNavigation();
IsBusy = false;
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoveryWordsViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoveryWordsViewModel.cs
@@ -26,7 +26,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
NextCommand = ReactiveCommand.Create(
() => NavigateTo(new ConfirmRecoveryWordsViewModel(navigationState, MnemonicWords, keyManager, walletManager), NavigationTarget.DialogScreen));
- CancelCommand = ReactiveCommand.Create(() => ClearNavigation(NavigationTarget.DialogScreen));
+ CancelCommand = ReactiveCommand.Create(() => ClearNavigation());
}
public List<RecoveryWordViewModel> MnemonicWords { get; set; }

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/AdvancedRecoveryOptionsViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/AdvancedRecoveryOptionsViewModel.cs
@@ -13,7 +13,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
private string _accountKeyPath;
private string _minGapLimit;
- public AdvancedRecoveryOptionsViewModel(NavigationStateViewModel navigationState, NavigationTarget navigationTarget, (KeyPath keyPath, int minGapLimit) interactionInput) : base(navigationState, navigationTarget)
+ public AdvancedRecoveryOptionsViewModel(NavigationStateViewModel navigationState, (KeyPath keyPath, int minGapLimit) interactionInput) : base(navigationState)
{
this.ValidateProperty(x => x.AccountKeyPath, ValidateAccountKeyPath);
this.ValidateProperty(x => x.MinGapLimit, ValidateMinGapLimit);

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/DialogViewModelBaseOfTResult.cs
WalletWasabi.Fluent/ViewModels/Dialogs/DialogViewModelBaseOfTResult.cs
@@ -18,7 +18,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
private readonly IDisposable _disposable;
private readonly TaskCompletionSource<TResult> _currentTaskCompletionSource;
- protected DialogViewModelBase(NavigationStateViewModel navigationState, NavigationTarget navigationTarget) : base(navigationState)
+ protected DialogViewModelBase(NavigationStateViewModel navigationState) : base(navigationState)
{
_currentTaskCompletionSource = new TaskCompletionSource<TResult>();

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/EnterPasswordViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/EnterPasswordViewModel.cs
@@ -12,7 +12,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
private string? _confirmPassword;
private string? _password;
- public EnterPasswordViewModel(NavigationStateViewModel navigationState, NavigationTarget navigationTarget, string subtitle) : base(navigationState, navigationTarget)
+ public EnterPasswordViewModel(NavigationStateViewModel navigationState, string subtitle) : base(navigationState)
{
Subtitle = subtitle;

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/TestDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/TestDialogViewModel.cs
@@ -8,7 +8,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
{
private string _message;
- public TestDialogViewModel(NavigationStateViewModel navigationState, NavigationTarget navigationTarget, string message) : base(navigationState, navigationTarget)
+ public TestDialogViewModel(NavigationStateViewModel navigationState, string message) : base(navigationState)
{
_message = message;

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
@@ -55,10 +55,13 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
}
public async Task<TResult> NavigateDialog<TResult>(DialogViewModelBase<TResult> dialog)
+ => await NavigateDialog(dialog, CurrentTarget);
+
+ public async Task<TResult> NavigateDialog<TResult>(DialogViewModelBase<TResult> dialog, NavigationTarget target)
{
TResult result;
- using (NavigateTo(dialog, NavigationTarget.DialogScreen))
+ using (NavigateTo(dialog, target))
{
result = await dialog.GetDialogResultAsync();
}
@@ -217,7 +220,7 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
}
}
- public void ClearNavigation(NavigationTarget navigationTarget)
+ private void ClearNavigation(NavigationTarget navigationTarget)
{
var router = GetRouter();
if (router is not null)
@@ -233,6 +236,6 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
}
}
- public void ClearNavigation() => ClearNavigation();
+ public void ClearNavigation() => ClearNavigation(CurrentTarget);
}
}

fix dialogs.