Show initial category count

This commit is contained in:
TheXamlGuy
2024-06-15 18:37:02 +01:00
parent 7a811acde5
commit a1784d75b8
14 changed files with 123 additions and 136 deletions
+4 -4
View File
@@ -8,20 +8,20 @@ public class NavigateHandler(NamedComponent scope,
{
public Task Handle(NavigateEventArgs args)
{
INavigationScope? navigationScope = null;
INavigation? navigationScope = null;
if (args.Scope is "self" || args.Scope is "new")
{
if (args.Sender is IServiceProviderRequired requireServiceProvider)
{
if (args.Scope is "self")
{
navigationScope = requireServiceProvider.Provider.GetRequiredService<INavigationScope>();
navigationScope = requireServiceProvider.Provider.GetRequiredService<INavigation>();
}
if (args.Scope is "new")
{
IServiceScope serviceScope = requireServiceProvider.Provider.CreateScope();
navigationScope = serviceScope.ServiceProvider.GetRequiredService<INavigationScope>();
navigationScope = serviceScope.ServiceProvider.GetRequiredService<INavigation>();
}
}
}
@@ -29,7 +29,7 @@ public class NavigateHandler(NamedComponent scope,
if (navigationScope is null)
{
ComponentScopeDescriptor? descriptor = componentScopeProvider.Get(args.Scope ?? scope.Name);
navigationScope = descriptor?.Services?.GetRequiredService<INavigationScope>();
navigationScope = descriptor?.Services?.GetRequiredService<INavigation>();
}
navigationScope?.Navigate(args.Route, args.Sender,