Make custom widgets independent of any WinUI framework concerns. Although one can add WinUI concerns to ther widget if they want to build a fully customized widget. In theory, it may also be possible to host a widget of WPF, Avalonia, or Blazor.

This commit is contained in:
TheXamlGuy
2024-01-06 09:57:23 +00:00
parent 3e88950669
commit 4a27534e39
41 changed files with 218 additions and 205 deletions
@@ -9,7 +9,7 @@ using System.Linq;
namespace Hyperbar.Windows;
public class TemplateFactory(ITemplateGeneratorFactory factory,
IEnumerable<IDataTemplateDescriptor> descriptors,
IEnumerable<IContentTemplateDescriptor> descriptors,
IServiceProvider provider) :
DataTemplateSelector,
ITemplateFactory
@@ -20,7 +20,7 @@ public class TemplateFactory(ITemplateGeneratorFactory factory,
public object? Create(object key)
{
if (descriptors.FirstOrDefault(x => x.Key == key) is IDataTemplateDescriptor descriptor)
if (descriptors.FirstOrDefault(x => x.Key == key) is IContentTemplateDescriptor descriptor)
{
if (provider.GetRequiredKeyedService(descriptor.TemplateType, descriptor.Key) is { } template)
{