Get ContentControl navigation working
This commit is contained in:
@@ -33,7 +33,7 @@ public static class IServiceCollectionExtensions
|
||||
services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType);
|
||||
services.TryAddKeyedTransient(key, (provider, key) => provider.GetService<IWidgetView>()!);
|
||||
|
||||
services.AddTransient<IViewModelTemplateDescriptor>(provider => new ViewModelTemplateDescriptor { ViewModelType = contentType, TemplateType = templateType, Key = key });
|
||||
services.AddTransient<IViewModelTemplate>(provider => new ViewModelTemplate { ViewModelType = contentType, TemplateType = templateType, Key = key });
|
||||
|
||||
return services;
|
||||
}
|
||||
@@ -54,8 +54,8 @@ public static class IServiceCollectionExtensions
|
||||
services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType);
|
||||
services.TryAddKeyedTransient(templateType, key);
|
||||
|
||||
services.AddTransient<IViewModelTemplateDescriptor>(provider =>
|
||||
new ViewModelTemplateDescriptor { ViewModelType = contentType,
|
||||
services.AddTransient<IViewModelTemplate>(provider =>
|
||||
new ViewModelTemplate { ViewModelType = contentType,
|
||||
TemplateType = templateType, Key = key });
|
||||
|
||||
return services;
|
||||
|
||||
@@ -29,8 +29,16 @@ public class WidgetBuilder :
|
||||
services.AddScoped<IServiceFactory>(provider =>
|
||||
new ServiceFactory((type, parameters) =>
|
||||
ActivatorUtilities.CreateInstance(provider, type, parameters!)));
|
||||
|
||||
services.AddSingleton<SubscriptionCollection>();
|
||||
services.AddSingleton<ISubscriptionManager, SubscriptionManager>();
|
||||
services.AddTransient<ISubscriber, Subscriber>();
|
||||
services.AddTransient<IPublisher, Publisher>();
|
||||
|
||||
services.AddScoped<IMediator, Mediator>();
|
||||
|
||||
services.AddScoped<IDisposer, Disposer>();
|
||||
|
||||
services.AddHandler<WidgetAvailabilityChangedHandler>();
|
||||
services.AddValueChangedNotification<WidgetConfiguration,
|
||||
WidgetAvailability>((config) => (args) =>
|
||||
|
||||
Reference in New Issue
Block a user