Get ContentControl navigation working

This commit is contained in:
TheXamlGuy
2024-02-11 18:09:22 +00:00
parent 565c6866d8
commit 812556f8b0
133 changed files with 335 additions and 195 deletions
@@ -12,14 +12,14 @@ public static class IServiceCollectionExtensions
// We need to feed information to the Widgets about our Windows host,
// so the Windows host can make discussions how to display and interact with the widgets.
services.AddTransient<IProxyServiceCollection<IWidgetBuilder>>(provider =>
services.AddTransient((Func<IServiceProvider, IProxyServiceCollection<IWidgetBuilder>>)(provider =>
new ProxyServiceCollection<IWidgetBuilder>(services =>
{
services.AddSingleton(provider.GetRequiredService<IList<IXamlMetadataProvider>>());
services.AddSingleton(provider.GetRequiredService<IDispatcher>());
services.AddTransient<IViewModelTemplate, ViewModelTemplate>();
services.AddTransient<IViewModelTemplateDescriptorProvider, ViewModelTemplateDescriptorProvider>();
services.AddTransient<IViewModelTemplateSelector, UI.Windows.ViewModelTemplateSelector>();
services.AddTransient<IViewModelTemplateProvider, ViewModelTemplateProvider>();
services.AddScoped<IVirtualKeyboard, VirtualKeyboard>();
services.AddHandler<KeyAcceleratorHandler>();
@@ -33,7 +33,7 @@ public static class IServiceCollectionExtensions
services.AddContentTemplate<WidgetButtonViewModel, WidgetButtonView>();
services.AddContentTemplate<WidgetSplitButtonViewModel, WidgetSplitButtonView>();
}));
})));
return services;
}
+2 -3
View File
@@ -4,10 +4,9 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:ui="using:Hyperbar.UI.Windows">
xmlns:interactivity="using:Microsoft.Xaml.Interactivity">
<Grid>
<ItemsControl ItemTemplateSelector="{Binding Template}" ItemsSource="{Binding Mode=TwoWay}">
<ItemsControl ItemTemplateSelector="{Binding ViewModelTemplateSelector}" ItemsSource="{Binding Mode=TwoWay}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="8" />