Rework navigation so we can resolve by key now

This commit is contained in:
Dan Clark
2024-11-17 23:09:26 +00:00
parent 796ef41e3f
commit 7a9028bbeb
26 changed files with 371 additions and 88 deletions
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml.Controls;
using Toolkit.Foundation;
namespace Toolkit.WinUI;
@@ -12,6 +13,9 @@ public static class IServiceCollectionExtensions
services.AddSingleton<IWindowRegistry, WindowRegistry>();
services.AddTransient<IContentTemplate, ContentTemplate>();
services.AddTransient<INavigationRegion, NavigationRegion>();
services.AddHandler<NavigateTemplateEventArgs, ContentControlHandler>(nameof(ContentControl));
services.AddTransient((Func<IServiceProvider, IProxyServiceCollection<IComponentBuilder>>)(provider =>
new ProxyServiceCollection<IComponentBuilder>(services =>
@@ -21,4 +25,4 @@ public static class IServiceCollectionExtensions
return services;
}
}
}