From d45076f2a97d9f0abbd5e395c15ef5f055ed68fe Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Thu, 4 Jan 2024 20:53:49 +0000 Subject: [PATCH] get plugin system working --- .../ContextualCommandBuilder.cs | 11 ++++ .../ContextualCommandView.xaml | 6 +-- .../ContextualCommandView.xaml.cs | 2 +- .../ContextualCommandViewModel.cs | 5 +- .../Hyperbar.Desktop.Contextual.csproj | 29 ++++++++++ Hyperbar.Desktop/App.xaml.cs | 39 ++++++++++---- Hyperbar.Desktop/Hyperbar.Desktop.csproj | 1 + .../Templates/IServiceCollectionExtensions.cs | 26 +++++++++ .../Templates/ITemplateGeneratorFactory.cs | 1 + .../Templates/TemplateGeneratorFactory.cs | 8 +-- Hyperbar.Desktop/Views/CommandViewModel.cs | 19 +++---- Hyperbar.sln | 18 +++++++ Hyperbar/IServiceCollectionExtensions.cs | 27 ---------- Hyperbar/{ => Lifecycles}/AppService.cs | 0 Hyperbar/Lifecycles/CommandContext.cs | 8 +++ Hyperbar/Lifecycles/ICommandBuilder.cs | 8 +++ Hyperbar/Lifecycles/ICommandContext.cs | 6 +++ Hyperbar/Lifecycles/ICommandViewModel.cs | 7 +++ Hyperbar/{ => Lifecycles}/IInitializer.cs | 0 .../IServiceCollectionExtensions.cs | 53 +++++++++++++++++++ .../{ => Templates}/DataTemplateDescriptor.cs | 0 .../IDataTemplateDescriptor.cs | 0 Hyperbar/{ => Templates}/ITemplateFactory.cs | 0 .../{ => Templates}/ITemplatedViewModel.cs | 0 24 files changed, 219 insertions(+), 55 deletions(-) create mode 100644 Hyperbar.Desktop.Contextual/ContextualCommandBuilder.cs rename {Hyperbar.Desktop/Views => Hyperbar.Desktop.Contextual}/ContextualCommandView.xaml (73%) rename {Hyperbar.Desktop/Views => Hyperbar.Desktop.Contextual}/ContextualCommandView.xaml.cs (80%) rename {Hyperbar.Desktop/Views => Hyperbar.Desktop.Contextual}/ContextualCommandViewModel.cs (78%) create mode 100644 Hyperbar.Desktop.Contextual/Hyperbar.Desktop.Contextual.csproj create mode 100644 Hyperbar.Desktop/Templates/IServiceCollectionExtensions.cs delete mode 100644 Hyperbar/IServiceCollectionExtensions.cs rename Hyperbar/{ => Lifecycles}/AppService.cs (100%) create mode 100644 Hyperbar/Lifecycles/CommandContext.cs create mode 100644 Hyperbar/Lifecycles/ICommandBuilder.cs create mode 100644 Hyperbar/Lifecycles/ICommandContext.cs create mode 100644 Hyperbar/Lifecycles/ICommandViewModel.cs rename Hyperbar/{ => Lifecycles}/IInitializer.cs (100%) create mode 100644 Hyperbar/Lifecycles/IServiceCollectionExtensions.cs rename Hyperbar/{ => Templates}/DataTemplateDescriptor.cs (100%) rename Hyperbar/{ => Templates}/IDataTemplateDescriptor.cs (100%) rename Hyperbar/{ => Templates}/ITemplateFactory.cs (100%) rename Hyperbar/{ => Templates}/ITemplatedViewModel.cs (100%) diff --git a/Hyperbar.Desktop.Contextual/ContextualCommandBuilder.cs b/Hyperbar.Desktop.Contextual/ContextualCommandBuilder.cs new file mode 100644 index 0000000..da53c81 --- /dev/null +++ b/Hyperbar.Desktop.Contextual/ContextualCommandBuilder.cs @@ -0,0 +1,11 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace Hyperbar.Desktop.Contextual; + +public class ContextualCommandBuilder : ICommandBuilder +{ + public void Create(IServiceCollection services) + { + services.AddCommandTemplate(); + } +} diff --git a/Hyperbar.Desktop/Views/ContextualCommandView.xaml b/Hyperbar.Desktop.Contextual/ContextualCommandView.xaml similarity index 73% rename from Hyperbar.Desktop/Views/ContextualCommandView.xaml rename to Hyperbar.Desktop.Contextual/ContextualCommandView.xaml index e608e52..cd71865 100644 --- a/Hyperbar.Desktop/Views/ContextualCommandView.xaml +++ b/Hyperbar.Desktop.Contextual/ContextualCommandView.xaml @@ -1,15 +1,15 @@ -