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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user