Added messaging pipeline

This commit is contained in:
TheXamlGuy
2024-01-06 13:57:18 +00:00
parent 4a27534e39
commit 53537aa4c7
60 changed files with 609 additions and 141 deletions
@@ -9,6 +9,6 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Hyperbar\Hyperbar.csproj" />
<ProjectReference Include="..\Hyperbar\Hyperbar.csproj" />
</ItemGroup>
</Project>
@@ -1,4 +1,3 @@
using Hyperbar.Lifecycles;
using Microsoft.Extensions.DependencyInjection;
namespace Hyperbar.Windows.Primary;
@@ -6,10 +5,7 @@ namespace Hyperbar.Windows.Primary;
public class PrimaryWidgetBuilder :
IWidgetBuilder
{
public void Create(IServiceCollection services)
{
services.AddConfiguration<PrimaryWidgetConfiguration>()
.AddTransient<PrimaryWidgetViewModel>();
}
public void Create(IServiceCollection services) => services.AddConfiguration<PrimaryWidgetConfiguration>()
.AddWidgetTemplate<PrimaryWidgetViewModel>();
}
@@ -1,14 +1,19 @@
using Hyperbar.Lifecycles;
using Hyperbar.Templates;
namespace Hyperbar.Windows.Primary;
namespace Hyperbar.Windows.Primary;
public class PrimaryWidgetViewModel :
WidgetViewModelBase
{
public PrimaryWidgetViewModel(ITemplateFactory templateFactory) : base(templateFactory)
public PrimaryWidgetViewModel(ITemplateFactory templateFactory,
IServiceFactory serviceFactory) : base(templateFactory, serviceFactory)
{
;
Add<WidgetButtonViewModel>("test 1", new Action(() => {
}));
Add<WidgetButtonViewModel>("test 2", new Action(() => { }));
Add<WidgetButtonViewModel>("test 4", new Action(() => { }));
Add<WidgetButtonViewModel>("test 5", new Action(() => { }));
}
}