return to login page after oobe.
MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddedWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddedWalletPageViewModel.cs
+using System.Linq;
using ReactiveUI;
+using WalletWasabi.Fluent.ViewModels.NavBar;
using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.AddWallet
@@ -19,9 +21,20 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
WalletName = walletName;
Type = type;
- NextCommand = ReactiveCommand.Create(() =>
+ NextCommand = ReactiveCommand.Create(
+ () =>
{
Navigate().Clear();
+
+ var navBar = NavigationManager.Get<NavBarViewModel>();
+
+ var wallet = navBar?.Items.FirstOrDefault(x => x.WalletName == walletName);
+
+ if (wallet is { } && navBar is { })
+ {
+ navBar.SelectedItem = wallet;
+ Navigate(NavigationTarget.HomeScreen).To(wallet, NavigationMode.Clear);
+ }
});
}

MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -75,6 +75,8 @@ namespace WalletWasabi.Fluent.ViewModels
_navBar = new NavBarViewModel(MainScreen, _walletManager);
+ NavigationManager.RegisterType(_navBar);
+
RegisterCategories(_searchPage);
RegisterViewModels();

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/NavigationManager.cs
WalletWasabi.Fluent/ViewModels/Navigation/NavigationManager.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using WalletWasabi.Gui.ViewModels;
namespace WalletWasabi.Fluent.ViewModels.Navigation
{
@@ -9,8 +10,28 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
{
private static readonly Dictionary<NavigationMetaData, InstanceGeneratorBase> NavigationEntries = new ();
+ private static readonly Dictionary<Type, ViewModelBase> TypeRegistry = new ();
+
public static IEnumerable<NavigationMetaData> MetaData => NavigationEntries.Keys.Select(x => x);
+ public static void RegisterType<T>(T instance) where T : ViewModelBase
+ {
+ if (!TypeRegistry.ContainsKey(typeof(T)))
+ {
+ TypeRegistry.Add(typeof(T), instance);
+ }
+ }
+
+ public static T? Get<T>() where T : ViewModelBase
+ {
+ if (TypeRegistry.ContainsKey(typeof(T)) && TypeRegistry[typeof(T)] is T vmb)
+ {
+ return vmb;
+ }
+
+ return null;
+ }
+
public static async Task<RoutableViewModel?> MaterialiseViewModel(NavigationMetaData metaData)
{
if (NavigationEntries.ContainsKey(metaData))

return to login page after oobe.