Custom logic to show background for AddViewModel
MODIFY
WalletWasabi.Fluent/ViewModels/SearchBar/SearchItemProvider.cs
WalletWasabi.Fluent/ViewModels/SearchBar/SearchItemProvider.cs
using System.Collections.Generic;
using System.Linq;
+using System.Reactive;
using System.Reactive.Linq;
using System.Threading.Tasks;
+using WalletWasabi.Fluent.ViewModels.AddWallet;
+using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
using WalletWasabi.Fluent.ViewModels.Navigation;
namespace WalletWasabi.Fluent.ViewModels.SearchBar;
@@ -20,8 +23,8 @@ public static class SearchItemProvider
.Where(m => m.Searchable)
.Select(m =>
{
- var func = CreateFunc(m);
- var searchItem = new ActionableItem(m.Title, m.Caption, func, m.Category ?? "No category", m.Keywords)
+ var onActivate = CreateOnActivateFunction(m);
+ var searchItem = new ActionableItem(m.Title, m.Caption, onActivate, m.Category ?? "No category", m.Keywords)
{
Icon = m.IconName
};
@@ -29,7 +32,7 @@ public static class SearchItemProvider
});
}
- private static Func<Task> CreateFunc(NavigationMetaData navigationMetaData)
+ private static Func<Task> CreateOnActivateFunction(NavigationMetaData navigationMetaData)
{
return async () =>
{
@@ -39,7 +42,23 @@ public static class SearchItemProvider
return;
}
+ if (vm is DialogViewModelBase<Unit> dialog)
+ {
+ if (dialog is AddWalletPageViewModel)
+ {
+ MainViewModel.Instance.IsOobeBackgroundVisible = true;
+ await dialog.NavigateDialogAsync(dialog, NavigationTarget.DialogScreen);
+ MainViewModel.Instance.IsOobeBackgroundVisible = false;
+ }
+ else
+ {
+ await dialog.NavigateDialogAsync(dialog, NavigationTarget.DialogScreen);
+ }
+ }
+ else
+ {
Navigate(vm.DefaultTarget).To(vm);
+ }
};
}

Custom logic to show background for AddViewModel