Add a factory for populating view models

This commit is contained in:
TheXamlGuy
2024-01-06 19:21:38 +00:00
parent 66f65185c8
commit d5cc92e6ba
17 changed files with 86 additions and 905 deletions
+5 -5
View File
@@ -1,15 +1,15 @@
namespace Hyperbar.Windows;
namespace Hyperbar.Windows;
public partial class CommandViewModel :
ObservableCollectionViewModel<IWidgetViewModel>,
ITemplatedViewModel
{
public CommandViewModel(ITemplateFactory templateFactory,
IServiceFactory serviceFactory,
IEnumerable<IWidgetViewModel> widgets) : base(serviceFactory)
public CommandViewModel(ITemplateFactory templateFactory,
IServiceFactory serviceFactory,
IEnumerable<IWidgetViewModel> items) : base(serviceFactory, items)
{
TemplateFactory = templateFactory;
AddRange(widgets);
}
public ITemplateFactory TemplateFactory { get; }