Add KeyBindingBehavior

This commit is contained in:
TheXamlGuy
2024-04-22 22:30:57 +01:00
parent 5cb7ea538e
commit 7fa80371a4
16 changed files with 77 additions and 32 deletions
+3 -3
View File
@@ -8,10 +8,10 @@ public class NavigateBackHandler(IComponentScopeProvider provider) :
public async Task Handle(NavigateBack args,
CancellationToken cancellationToken)
{
if (provider.Get(args.Scope ?? "Default")
is IServiceProvider scope)
if (provider.Get(args.Scope ?? "Root")
is ComponentScopeDescriptor descriptor)
{
if (scope.GetService<INavigationScope>() is INavigationScope navigationScope)
if (descriptor?.Services?.GetService<INavigationScope>() is INavigationScope navigationScope)
{
await navigationScope.NavigateBackAsync(args.Context, cancellationToken);
}