wrapped custom widget items in containers so we have more control of the surrounding, i.e. divider

This commit is contained in:
TheXamlGuy
2024-01-10 19:25:16 +00:00
parent 197454ba1e
commit d7d90b3d54
45 changed files with 352 additions and 110 deletions
@@ -0,0 +1,21 @@
using Microsoft.Extensions.DependencyInjection;
namespace Hyperbar.Windows.UI;
public class TemplateFactory(IEnumerable<IContentTemplateDescriptor> descriptors,
IServiceProvider provider) :
ITemplateFactory
{
public object? Create(object key)
{
if (descriptors.FirstOrDefault(x => x.Key == key) is IContentTemplateDescriptor descriptor)
{
if (provider.GetRequiredKeyedService(descriptor.TemplateType, descriptor.Key) is { } template)
{
return template;
}
}
return default;
}
}