Use dialog screen for enter password view
MODIFY
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
@@ -35,7 +35,11 @@ namespace WalletWasabi.Fluent.ViewModels
CreateWalletCommand = ReactiveCommand.CreateFromTask(
async () =>
{
- var result = await PasswordInteraction.Handle("").ToTask();
+ var enterPassword = new EnterPasswordViewModel(navigationState, NavigationTarget.Dialog);
+
+ navigationState.DialogScreen?.Invoke().Router.Navigate.Execute(enterPassword);
+
+ var result = await enterPassword.GetDialogResultAsync();
if (result is { } password)
{
@@ -54,12 +58,12 @@ namespace WalletWasabi.Fluent.ViewModels
await navigationState.DialogScreen?.Invoke().Router.Navigate.Execute(
new RecoveryWordsViewModel(navigationState, km, mnemonic, walletManager));
}
+ else
+ {
+ ClearNavigation();
+ }
});
- PasswordInteraction = new Interaction<string, string?>();
- PasswordInteraction.RegisterHandler(
- async interaction => interaction.SetOutput(await new EnterPasswordViewModel(navigationState, NavigationTarget.Default).ShowDialogAsync()));
-
this.ValidateProperty(x => x.WalletName, errors => ValidateWalletName(errors, walletManager, WalletName));
}
@@ -104,8 +108,6 @@ namespace WalletWasabi.Fluent.ViewModels
set => this.RaiseAndSetIfChanged(ref _optionsEnabled, value);
}
- private Interaction<string, string?> PasswordInteraction { get; }
-
public ICommand CreateWalletCommand { get; }
public ICommand RecoverWalletCommand { get; }
}

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/DialogViewModelBaseOfTResult.cs
WalletWasabi.Fluent/ViewModels/Dialogs/DialogViewModelBaseOfTResult.cs
@@ -77,6 +77,17 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
return _currentTaskCompletionSource.Task;
}
+ /// <summary>
+ /// Gets the dialog result.
+ /// </summary>
+ /// <returns>The value to be returned when the dialog is finished.</returns>
+ public Task<TResult> GetDialogResultAsync()
+ {
+ IsDialogOpen = true;
+
+ return _currentTaskCompletionSource.Task;
+ }
+
/// <summary>
/// Method that is triggered when the dialog is closed.
/// </summary>

Use dialog screen for enter password view