always show the oobe background during add wallet procedure.
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
using ReactiveUI;
using System;
using System.IO;
+using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using WalletWasabi.Blockchain.Keys;
using WalletWasabi.Fluent.Validation;
+using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
using WalletWasabi.Models;
using WalletWasabi.Fluent.ViewModels.NavBar;
@@ -19,7 +21,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
IconName = "add_circle_regular",
NavigationTarget = NavigationTarget.DialogScreen,
NavBarPosition = NavBarPosition.Bottom)]
- public partial class AddWalletPageViewModel : NavBarItemViewModel
+ public partial class AddWalletPageViewModel : DialogViewModelBase<Unit>
{
[AutoNotify] private string _walletName = "";
@@ -33,6 +35,16 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
NextCommand = ReactiveCommand.Create(OnNext, canExecute);
+ OpenCommand = ReactiveCommand.Create(async
+ () =>
+ {
+ MainViewModel.Instance.IsOobeBackgroundVisible = true;
+
+ await NavigateDialogAsync(this, NavigationTarget.DialogScreen);
+
+ MainViewModel.Instance.IsOobeBackgroundVisible = false;
+ });
+
this.ValidateProperty(x => x.WalletName, errors => ValidateWalletName(errors, WalletName));
}
@@ -70,6 +82,11 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
}
}
+ protected override void OnNavigatedFrom(bool isInHistory)
+ {
+ base.OnNavigatedFrom(isInHistory);
+ }
+
protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
{
base.OnNavigatedTo(isInHistory, disposables);

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/Base/DialogViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Dialogs/Base/DialogViewModelBase.cs
+using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.Dialogs.Base
@@ -5,7 +6,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.Base
/// <summary>
/// CommonBase class.
/// </summary>
- public abstract partial class DialogViewModelBase : RoutableViewModel
+ public abstract partial class DialogViewModelBase : NavBarItemViewModel
{
[AutoNotify] private bool _isDialogOpen;
}

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/Base/DialogViewModelBaseOfTResult.cs
WalletWasabi.Fluent/ViewModels/Dialogs/Base/DialogViewModelBaseOfTResult.cs
@@ -14,7 +14,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.Base
public abstract class DialogViewModelBase<TResult> : DialogViewModelBase
{
private readonly IDisposable _disposable;
- private readonly TaskCompletionSource<DialogResult<TResult>> _currentTaskCompletionSource;
+ private TaskCompletionSource<DialogResult<TResult>>? _currentTaskCompletionSource;
protected DialogViewModelBase()
{
@@ -54,7 +54,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.Base
/// <param name="result">The return value of the dialog</param>
protected void Close(DialogResultKind kind = DialogResultKind.Normal, TResult result = default)
{
- if (_currentTaskCompletionSource.Task.IsCompleted)
+ if (_currentTaskCompletionSource!.Task.IsCompleted)
{
return;
}
@@ -63,6 +63,8 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.Base
_disposable.Dispose();
+ _currentTaskCompletionSource = new TaskCompletionSource<DialogResult<TResult>>();
+
IsDialogOpen = false;
OnDialogClosed();
@@ -76,7 +78,7 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs.Base
{
IsDialogOpen = true;
- return _currentTaskCompletionSource.Task;
+ return _currentTaskCompletionSource!.Task;
}
/// <summary>

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/NavigationStack.cs
WalletWasabi.Fluent/ViewModels/Navigation/NavigationStack.cs
@@ -87,6 +87,11 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
{
foreach (var item in oldItems)
{
+ if (item is INavigatable navigatable)
+ {
+ navigatable.OnNavigatedFrom(false);
+ }
+
OnPopped(item);
}

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/TargettedNavigationStack.cs
WalletWasabi.Fluent/ViewModels/Navigation/TargettedNavigationStack.cs
@@ -44,11 +44,6 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
{
base.OnPopped(page);
- if (page is INavigatable navigatable)
- {
- navigatable.OnNavigatedFrom(false);
- }
-
page.CurrentTarget = NavigationTarget.Default;
}

always show the oobe background during add wallet procedure.