cope with broadcaster dialog returning null safely.
MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/NavigationManager.cs
WalletWasabi.Fluent/ViewModels/Navigation/NavigationManager.cs
@@ -11,7 +11,7 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
public static IEnumerable<NavigationMetaData> MetaData => NavigationEntries.Keys.Select(x => x);
- public static async Task<RoutableViewModel> MaterialiseViewModel(NavigationMetaData metaData)
+ public static async Task<RoutableViewModel?> MaterialiseViewModel(NavigationMetaData metaData)
{
if (NavigationEntries.ContainsKey(metaData))
{
@@ -32,7 +32,7 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
throw new Exception("ViewModel metadata not registered.");
}
- public static void RegisterAsyncLazy(NavigationMetaData metaData, Func<Task<RoutableViewModel>> generator)
+ public static void RegisterAsyncLazy(NavigationMetaData metaData, Func<Task<RoutableViewModel?>> generator)
{
if (metaData.Searchable && (metaData.Category is null || metaData.Title is null))
{
@@ -45,7 +45,7 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
}
}
- public static void RegisterLazy(NavigationMetaData metaData, Func<RoutableViewModel> generator)
+ public static void RegisterLazy(NavigationMetaData metaData, Func<RoutableViewModel?> generator)
{
if (metaData.Searchable && (metaData.Category is null || metaData.Title is null))
{
@@ -77,22 +77,22 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
private class AsyncInstanceGenerator : InstanceGeneratorBase
{
- public AsyncInstanceGenerator(Func<Task<RoutableViewModel>> generate)
+ public AsyncInstanceGenerator(Func<Task<RoutableViewModel?>> generate)
{
Generate = generate;
}
- public Func<Task<RoutableViewModel>> Generate { get; }
+ public Func<Task<RoutableViewModel?>> Generate { get; }
}
private class SynchronousInstanceGenerator : InstanceGeneratorBase
{
- public SynchronousInstanceGenerator(Func<RoutableViewModel> generate)
+ public SynchronousInstanceGenerator(Func<RoutableViewModel?> generate)
{
Generate = generate;
}
- public Func<RoutableViewModel> Generate { get; }
+ public Func<RoutableViewModel?> Generate { get; }
}
private class InstanceGenerator : InstanceGeneratorBase

MODIFY
WalletWasabi.Fluent/ViewModels/Search/SearchItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Search/SearchItemViewModel.cs
@@ -21,7 +21,12 @@ namespace WalletWasabi.Fluent.ViewModels.Search
{
owner.IsBusy = true;
var view = await NavigationManager.MaterialiseViewModel(metaData);
+
+ if (view is { })
+ {
Navigate(view.DefaultTarget).To(view);
+ }
+
owner.IsBusy = false;
});
}
@@ -38,6 +43,6 @@ namespace WalletWasabi.Fluent.ViewModels.Search
public ICommand OpenCommand { get; }
- public string IconName => _metaData.IconName;
+ public override string IconName => _metaData.IconName;
}
}
\ No newline at end of file

cope with broadcaster dialog returning null safely.