From 5e26e97f6b6a9a1ed5eb220bc67e4578308aafd2 Mon Sep 17 00:00:00 2001 From: TheXamlGuy Date: Wed, 24 Jan 2024 20:50:59 +0000 Subject: [PATCH] break widget related stuff into its own project as the main HB project was just becoming too bloated --- Hyperbar.Widget/Hyperbar.Widget.csproj | 10 +++ .../IServiceCollectionExtensions.cs | 65 +++++++++++++++++++ .../Widgets => Hyperbar.Widget}/IWidget.cs | 2 +- .../IWidgetBuilder.cs | 2 +- .../IWidgetBuilderExtensions.cs | 2 +- .../IWidgetComponentViewModel.cs | 2 +- .../IWidgetHost.cs | 2 +- .../Views => Hyperbar.Widget}/IWidgetView.cs | 2 +- .../IWidgetViewModel.cs | 2 +- .../Widgets => Hyperbar.Widget}/Started.cs | 2 +- .../Widgets => Hyperbar.Widget}/Stopped.cs | 2 +- .../WidgetAssembly.cs | 2 +- .../WidgetAssemblyHandler.cs | 2 +- .../WidgetAvailability.cs | 2 +- .../WidgetBarViewModel.cs | 2 +- .../WidgetBuilder.cs | 2 +- .../WidgetButtonViewModel.cs | 2 +- .../WidgetComponentViewModel.cs | 2 +- .../WidgetConfiguration.cs | 2 +- .../WidgetConfigurationChanged.cs | 2 +- .../WidgetConfigurationHandler.cs | 2 +- .../WidgetContainerFactory.cs | 2 +- .../WidgetContainerViewModel.cs | 2 +- .../WidgetEnumeratorHandler.cs | 4 +- .../WidgetFactory.cs | 2 +- .../WidgetHandler.cs | 2 +- .../Widgets => Hyperbar.Widget}/WidgetHost.cs | 2 +- .../WidgetHostHandler.cs | 6 +- .../WidgetManager.cs | 2 +- .../WidgetMenuViewModel.cs | 2 +- .../WidgetMonitor.cs | 2 +- .../WidgetService.cs | 2 +- .../WidgetSplitButtonViewModel.cs | 2 +- Hyperbar.Widget/WidgetViewModelEnumerator.cs | 11 ++++ .../Hyperbar.Widget.Contextual.csproj | 1 + .../Hyperbar.Windows.MediaController.csproj | 1 + .../Lifecycles/MediaControllerWidget.cs | 1 + .../MediaControllerWidgetConfiguration.cs | 4 +- .../Views/MediaButtonViewModel.cs | 1 + .../Views/MediaControllerViewModel.cs | 1 + .../Views/MediaControllerWidgetViewModel.cs | 4 +- .../Views/MediaInformationViewModel.cs | 1 + .../Hyperbar.Widget.Primary.csproj | 1 + Hyperbar.Windows.Primary/PrimaryWidget.cs | 1 + .../PrimaryWidgetConfiguration.cs | 7 +- .../PrimaryWidgetConfigurationHandler.cs | 4 +- .../PrimaryWidgetViewModel.cs | 4 +- .../WidgetComponentEnumerationHandler.cs | 4 +- .../WidgetComponentFactory.cs | 1 + .../WidgetComponentProvider.cs | 4 +- Hyperbar.Windows/App.xaml.cs | 3 +- Hyperbar.Windows/Hyperbar.Windows.csproj | 1 + Hyperbar.Windows/Lifecycles/AppInitializer.cs | 3 +- Hyperbar.Windows/Views/WidgetView.xaml.cs | 1 + Hyperbar.sln | 20 +++++- .../IServiceCollectionExtensions.cs | 51 +-------------- Hyperbar/{Views => Lifecycles}/IEnumerator.cs | 0 .../{Views => Lifecycles}/IInitialization.cs | 0 .../IObservableCollectionViewModel.cs | 0 .../ObservableCollectionViewModel.cs | 0 .../ObservableViewModel.cs | 0 61 files changed, 178 insertions(+), 95 deletions(-) create mode 100644 Hyperbar.Widget/Hyperbar.Widget.csproj create mode 100644 Hyperbar.Widget/IServiceCollectionExtensions.cs rename {Hyperbar/Widgets => Hyperbar.Widget}/IWidget.cs (66%) rename {Hyperbar/Widgets => Hyperbar.Widget}/IWidgetBuilder.cs (92%) rename {Hyperbar/Widgets => Hyperbar.Widget}/IWidgetBuilderExtensions.cs (92%) rename {Hyperbar/Views => Hyperbar.Widget}/IWidgetComponentViewModel.cs (65%) rename {Hyperbar/Widgets => Hyperbar.Widget}/IWidgetHost.cs (82%) rename {Hyperbar/Views => Hyperbar.Widget}/IWidgetView.cs (50%) rename {Hyperbar/Views => Hyperbar.Widget}/IWidgetViewModel.cs (62%) rename {Hyperbar/Widgets => Hyperbar.Widget}/Started.cs (67%) rename {Hyperbar/Widgets => Hyperbar.Widget}/Stopped.cs (67%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetAssembly.cs (80%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetAssemblyHandler.cs (96%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetAvailability.cs (71%) rename {Hyperbar/Views => Hyperbar.Widget}/WidgetBarViewModel.cs (93%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetBuilder.cs (98%) rename {Hyperbar/Views => Hyperbar.Widget}/WidgetButtonViewModel.cs (96%) rename {Hyperbar/Views => Hyperbar.Widget}/WidgetComponentViewModel.cs (97%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetConfiguration.cs (92%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetConfigurationChanged.cs (74%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetConfigurationHandler.cs (94%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetContainerFactory.cs (94%) rename {Hyperbar/Views => Hyperbar.Widget}/WidgetContainerViewModel.cs (94%) rename Hyperbar/Widgets/WidgetEnumerationHandler.cs => Hyperbar.Widget/WidgetEnumeratorHandler.cs (91%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetFactory.cs (89%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetHandler.cs (97%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetHost.cs (98%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetHostHandler.cs (84%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetManager.cs (87%) rename {Hyperbar/Views => Hyperbar.Widget}/WidgetMenuViewModel.cs (96%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetMonitor.cs (82%) rename {Hyperbar/Widgets => Hyperbar.Widget}/WidgetService.cs (94%) rename {Hyperbar/Views => Hyperbar.Widget}/WidgetSplitButtonViewModel.cs (96%) create mode 100644 Hyperbar.Widget/WidgetViewModelEnumerator.cs rename Hyperbar/{Views => Lifecycles}/IEnumerator.cs (100%) rename Hyperbar/{Views => Lifecycles}/IInitialization.cs (100%) rename Hyperbar/{Views => Lifecycles}/IObservableCollectionViewModel.cs (100%) rename Hyperbar/{Views => Lifecycles}/ObservableCollectionViewModel.cs (100%) rename Hyperbar/{Views => Lifecycles}/ObservableViewModel.cs (100%) diff --git a/Hyperbar.Widget/Hyperbar.Widget.csproj b/Hyperbar.Widget/Hyperbar.Widget.csproj new file mode 100644 index 0000000..3ecc5a3 --- /dev/null +++ b/Hyperbar.Widget/Hyperbar.Widget.csproj @@ -0,0 +1,10 @@ + + + net8.0 + enable + enable + + + + + \ No newline at end of file diff --git a/Hyperbar.Widget/IServiceCollectionExtensions.cs b/Hyperbar.Widget/IServiceCollectionExtensions.cs new file mode 100644 index 0000000..5470f3b --- /dev/null +++ b/Hyperbar.Widget/IServiceCollectionExtensions.cs @@ -0,0 +1,65 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; + +namespace Hyperbar.Widget; + +public static class IServiceCollectionExtensions +{ + public static IServiceCollection AddWidget(this IServiceCollection services) + { + services.AddTransient(); + services.AddTransient, WidgetFactory>(); + + services.AddHandler(); + services.AddHandler(); + services.AddHandler(); + services.AddHandler(); + + services.AddTransient, WidgetContainerFactory>(); + + return services; + } + + public static IServiceCollection AddWidgetTemplate(this IServiceCollection services) + where TWidgetContent : + IWidgetViewModel + { + Type contentType = typeof(TWidgetContent); + Type templateType = typeof(IWidgetView); + + string key = contentType.Name; + + services.AddTransient(typeof(IWidgetViewModel), contentType); + services.TryAddTransient(templateType, provider => provider.GetService()!); + + services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType); + services.TryAddKeyedTransient(key, (provider, key) => provider.GetService()!); + + services.AddTransient(provider => new ContentTemplateDescriptor { ContentType = contentType, TemplateType = templateType, Key = key }); + + return services; + } + + public static IServiceCollection AddWidgetTemplate(this IServiceCollection services) + where TWidgetContent : + IWidgetViewModel + { + Type contentType = typeof(TWidgetContent); + Type templateType = typeof(TWidgetTemplate); + + string key = contentType.Name; + + services.AddTransient(typeof(IWidgetViewModel), contentType); + services.TryAddTransient(templateType); + + services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType); + services.TryAddKeyedTransient(templateType, key); + + services.AddTransient(provider => + new ContentTemplateDescriptor { ContentType = contentType, + TemplateType = templateType, Key = key }); + + return services; + } +} \ No newline at end of file diff --git a/Hyperbar/Widgets/IWidget.cs b/Hyperbar.Widget/IWidget.cs similarity index 66% rename from Hyperbar/Widgets/IWidget.cs rename to Hyperbar.Widget/IWidget.cs index 90b46c7..929007b 100644 --- a/Hyperbar/Widgets/IWidget.cs +++ b/Hyperbar.Widget/IWidget.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public interface IWidget { diff --git a/Hyperbar/Widgets/IWidgetBuilder.cs b/Hyperbar.Widget/IWidgetBuilder.cs similarity index 92% rename from Hyperbar/Widgets/IWidgetBuilder.cs rename to Hyperbar.Widget/IWidgetBuilder.cs index 9c38ab0..1742ec2 100644 --- a/Hyperbar/Widgets/IWidgetBuilder.cs +++ b/Hyperbar.Widget/IWidgetBuilder.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; -namespace Hyperbar; +namespace Hyperbar.Widget; public interface IWidgetBuilder { diff --git a/Hyperbar/Widgets/IWidgetBuilderExtensions.cs b/Hyperbar.Widget/IWidgetBuilderExtensions.cs similarity index 92% rename from Hyperbar/Widgets/IWidgetBuilderExtensions.cs rename to Hyperbar.Widget/IWidgetBuilderExtensions.cs index cc8e53a..07d5481 100644 --- a/Hyperbar/Widgets/IWidgetBuilderExtensions.cs +++ b/Hyperbar.Widget/IWidgetBuilderExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; -namespace Hyperbar; +namespace Hyperbar.Widget; public static class IWidgetBuilderExtensions { diff --git a/Hyperbar/Views/IWidgetComponentViewModel.cs b/Hyperbar.Widget/IWidgetComponentViewModel.cs similarity index 65% rename from Hyperbar/Views/IWidgetComponentViewModel.cs rename to Hyperbar.Widget/IWidgetComponentViewModel.cs index 6cf934f..5d7931c 100644 --- a/Hyperbar/Views/IWidgetComponentViewModel.cs +++ b/Hyperbar.Widget/IWidgetComponentViewModel.cs @@ -1,3 +1,3 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public interface IWidgetComponentViewModel : IDisposable; \ No newline at end of file diff --git a/Hyperbar/Widgets/IWidgetHost.cs b/Hyperbar.Widget/IWidgetHost.cs similarity index 82% rename from Hyperbar/Widgets/IWidgetHost.cs rename to Hyperbar.Widget/IWidgetHost.cs index 0d01f41..8d35a59 100644 --- a/Hyperbar/Widgets/IWidgetHost.cs +++ b/Hyperbar.Widget/IWidgetHost.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public interface IWidgetHost : IInitializer diff --git a/Hyperbar/Views/IWidgetView.cs b/Hyperbar.Widget/IWidgetView.cs similarity index 50% rename from Hyperbar/Views/IWidgetView.cs rename to Hyperbar.Widget/IWidgetView.cs index ab21bb5..0e29631 100644 --- a/Hyperbar/Views/IWidgetView.cs +++ b/Hyperbar.Widget/IWidgetView.cs @@ -1,3 +1,3 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public interface IWidgetView; \ No newline at end of file diff --git a/Hyperbar/Views/IWidgetViewModel.cs b/Hyperbar.Widget/IWidgetViewModel.cs similarity index 62% rename from Hyperbar/Views/IWidgetViewModel.cs rename to Hyperbar.Widget/IWidgetViewModel.cs index ff92d9f..e4f5838 100644 --- a/Hyperbar/Views/IWidgetViewModel.cs +++ b/Hyperbar.Widget/IWidgetViewModel.cs @@ -1,3 +1,3 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public interface IWidgetViewModel : IDisposable; \ No newline at end of file diff --git a/Hyperbar/Widgets/Started.cs b/Hyperbar.Widget/Started.cs similarity index 67% rename from Hyperbar/Widgets/Started.cs rename to Hyperbar.Widget/Started.cs index 899d61e..758c278 100644 --- a/Hyperbar/Widgets/Started.cs +++ b/Hyperbar.Widget/Started.cs @@ -1,3 +1,3 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public record Started(TValue Value) : INotification; diff --git a/Hyperbar/Widgets/Stopped.cs b/Hyperbar.Widget/Stopped.cs similarity index 67% rename from Hyperbar/Widgets/Stopped.cs rename to Hyperbar.Widget/Stopped.cs index 6a01900..d1ac4ae 100644 --- a/Hyperbar/Widgets/Stopped.cs +++ b/Hyperbar.Widget/Stopped.cs @@ -1,3 +1,3 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public record Stopped(TValue Value) : INotification; \ No newline at end of file diff --git a/Hyperbar/Widgets/WidgetAssembly.cs b/Hyperbar.Widget/WidgetAssembly.cs similarity index 80% rename from Hyperbar/Widgets/WidgetAssembly.cs rename to Hyperbar.Widget/WidgetAssembly.cs index 7bd26cd..ac2138a 100644 --- a/Hyperbar/Widgets/WidgetAssembly.cs +++ b/Hyperbar.Widget/WidgetAssembly.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace Hyperbar; +namespace Hyperbar.Widget; public record WidgetAssembly(Assembly? Assembly = default) : INotification; \ No newline at end of file diff --git a/Hyperbar/Widgets/WidgetAssemblyHandler.cs b/Hyperbar.Widget/WidgetAssemblyHandler.cs similarity index 96% rename from Hyperbar/Widgets/WidgetAssemblyHandler.cs rename to Hyperbar.Widget/WidgetAssemblyHandler.cs index 6b4f793..cf3d230 100644 --- a/Hyperbar/Widgets/WidgetAssemblyHandler.cs +++ b/Hyperbar.Widget/WidgetAssemblyHandler.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetAssemblyHandler(IMediator mediator, IFactory factory) : diff --git a/Hyperbar/Widgets/WidgetAvailability.cs b/Hyperbar.Widget/WidgetAvailability.cs similarity index 71% rename from Hyperbar/Widgets/WidgetAvailability.cs rename to Hyperbar.Widget/WidgetAvailability.cs index a1bb444..5a0b9f2 100644 --- a/Hyperbar/Widgets/WidgetAvailability.cs +++ b/Hyperbar.Widget/WidgetAvailability.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public record WidgetAvailability { diff --git a/Hyperbar/Views/WidgetBarViewModel.cs b/Hyperbar.Widget/WidgetBarViewModel.cs similarity index 93% rename from Hyperbar/Views/WidgetBarViewModel.cs rename to Hyperbar.Widget/WidgetBarViewModel.cs index 1594e9a..e5197b7 100644 --- a/Hyperbar/Views/WidgetBarViewModel.cs +++ b/Hyperbar.Widget/WidgetBarViewModel.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; [NotificationHandler(nameof(WidgetBarViewModel))] public partial class WidgetBarViewModel(ITemplateFactory templateFactory, diff --git a/Hyperbar/Widgets/WidgetBuilder.cs b/Hyperbar.Widget/WidgetBuilder.cs similarity index 98% rename from Hyperbar/Widgets/WidgetBuilder.cs rename to Hyperbar.Widget/WidgetBuilder.cs index 91f897a..7ba795e 100644 --- a/Hyperbar/Widgets/WidgetBuilder.cs +++ b/Hyperbar.Widget/WidgetBuilder.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System.Reflection; -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetBuilder(TConfiguration configuration) : IWidgetBuilder diff --git a/Hyperbar/Views/WidgetButtonViewModel.cs b/Hyperbar.Widget/WidgetButtonViewModel.cs similarity index 96% rename from Hyperbar/Views/WidgetButtonViewModel.cs rename to Hyperbar.Widget/WidgetButtonViewModel.cs index f96efa7..61f947a 100644 --- a/Hyperbar/Views/WidgetButtonViewModel.cs +++ b/Hyperbar.Widget/WidgetButtonViewModel.cs @@ -1,7 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -namespace Hyperbar; +namespace Hyperbar.Widget; [NotificationHandler(nameof(Id))] public partial class WidgetButtonViewModel(IServiceFactory serviceFactory, diff --git a/Hyperbar/Views/WidgetComponentViewModel.cs b/Hyperbar.Widget/WidgetComponentViewModel.cs similarity index 97% rename from Hyperbar/Views/WidgetComponentViewModel.cs rename to Hyperbar.Widget/WidgetComponentViewModel.cs index 1e934fa..e07dc6a 100644 --- a/Hyperbar/Views/WidgetComponentViewModel.cs +++ b/Hyperbar.Widget/WidgetComponentViewModel.cs @@ -1,6 +1,6 @@ using CommunityToolkit.Mvvm.ComponentModel; -namespace Hyperbar; +namespace Hyperbar.Widget; public partial class WidgetComponentViewModel : ObservableCollectionViewModel, diff --git a/Hyperbar/Widgets/WidgetConfiguration.cs b/Hyperbar.Widget/WidgetConfiguration.cs similarity index 92% rename from Hyperbar/Widgets/WidgetConfiguration.cs rename to Hyperbar.Widget/WidgetConfiguration.cs index 5cd45e5..8da6a25 100644 --- a/Hyperbar/Widgets/WidgetConfiguration.cs +++ b/Hyperbar.Widget/WidgetConfiguration.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetConfiguration { public string? Description { get; set; } diff --git a/Hyperbar/Widgets/WidgetConfigurationChanged.cs b/Hyperbar.Widget/WidgetConfigurationChanged.cs similarity index 74% rename from Hyperbar/Widgets/WidgetConfigurationChanged.cs rename to Hyperbar.Widget/WidgetConfigurationChanged.cs index 699b35e..d458cd6 100644 --- a/Hyperbar/Widgets/WidgetConfigurationChanged.cs +++ b/Hyperbar.Widget/WidgetConfigurationChanged.cs @@ -1,4 +1,4 @@  -namespace Hyperbar; +namespace Hyperbar.Widget; public record WidgetConfigurationChanged : INotification; \ No newline at end of file diff --git a/Hyperbar/Widgets/WidgetConfigurationHandler.cs b/Hyperbar.Widget/WidgetConfigurationHandler.cs similarity index 94% rename from Hyperbar/Widgets/WidgetConfigurationHandler.cs rename to Hyperbar.Widget/WidgetConfigurationHandler.cs index ff3764f..32bfbba 100644 --- a/Hyperbar/Widgets/WidgetConfigurationHandler.cs +++ b/Hyperbar.Widget/WidgetConfigurationHandler.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetConfigurationHandler(IValue widgetAvailability) : INotificationHandler> diff --git a/Hyperbar/Widgets/WidgetContainerFactory.cs b/Hyperbar.Widget/WidgetContainerFactory.cs similarity index 94% rename from Hyperbar/Widgets/WidgetContainerFactory.cs rename to Hyperbar.Widget/WidgetContainerFactory.cs index 2ea9953..437ad96 100644 --- a/Hyperbar/Widgets/WidgetContainerFactory.cs +++ b/Hyperbar.Widget/WidgetContainerFactory.cs @@ -1,5 +1,5 @@ using Microsoft.Extensions.DependencyInjection; -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetContainerFactory(IServiceFactory factory) : IFactory diff --git a/Hyperbar/Views/WidgetContainerViewModel.cs b/Hyperbar.Widget/WidgetContainerViewModel.cs similarity index 94% rename from Hyperbar/Views/WidgetContainerViewModel.cs rename to Hyperbar.Widget/WidgetContainerViewModel.cs index d1a5432..83ea805 100644 --- a/Hyperbar/Views/WidgetContainerViewModel.cs +++ b/Hyperbar.Widget/WidgetContainerViewModel.cs @@ -1,7 +1,7 @@  using CommunityToolkit.Mvvm.ComponentModel; -namespace Hyperbar; +namespace Hyperbar.Widget; public partial class WidgetContainerViewModel(ITemplateFactory templateFactory, IServiceFactory serviceFactory, diff --git a/Hyperbar/Widgets/WidgetEnumerationHandler.cs b/Hyperbar.Widget/WidgetEnumeratorHandler.cs similarity index 91% rename from Hyperbar/Widgets/WidgetEnumerationHandler.cs rename to Hyperbar.Widget/WidgetEnumeratorHandler.cs index 8756618..20d36db 100644 --- a/Hyperbar/Widgets/WidgetEnumerationHandler.cs +++ b/Hyperbar.Widget/WidgetEnumeratorHandler.cs @@ -2,9 +2,9 @@ using System.Reflection; using System.Runtime.Loader; -namespace Hyperbar; +namespace Hyperbar.Widget; -public class WidgetEnumerationHandler(IHostEnvironment hostEnvironment, +public class WidgetEnumeratorHandler(IHostEnvironment hostEnvironment, IMediator mediator) : INotificationHandler> { diff --git a/Hyperbar/Widgets/WidgetFactory.cs b/Hyperbar.Widget/WidgetFactory.cs similarity index 89% rename from Hyperbar/Widgets/WidgetFactory.cs rename to Hyperbar.Widget/WidgetFactory.cs index 8f14ea8..25c7b8c 100644 --- a/Hyperbar/Widgets/WidgetFactory.cs +++ b/Hyperbar.Widget/WidgetFactory.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetFactory : IFactory diff --git a/Hyperbar/Widgets/WidgetHandler.cs b/Hyperbar.Widget/WidgetHandler.cs similarity index 97% rename from Hyperbar/Widgets/WidgetHandler.cs rename to Hyperbar.Widget/WidgetHandler.cs index af55de5..26c75fa 100644 --- a/Hyperbar/Widgets/WidgetHandler.cs +++ b/Hyperbar.Widget/WidgetHandler.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetHandler(IProxyServiceCollection typedServices, IServiceProvider provider, diff --git a/Hyperbar/Widgets/WidgetHost.cs b/Hyperbar.Widget/WidgetHost.cs similarity index 98% rename from Hyperbar/Widgets/WidgetHost.cs rename to Hyperbar.Widget/WidgetHost.cs index e75f7d5..e3c9b8f 100644 --- a/Hyperbar/Widgets/WidgetHost.cs +++ b/Hyperbar.Widget/WidgetHost.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetHost : INotificationHandler>, diff --git a/Hyperbar/Widgets/WidgetHostHandler.cs b/Hyperbar.Widget/WidgetHostHandler.cs similarity index 84% rename from Hyperbar/Widgets/WidgetHostHandler.cs rename to Hyperbar.Widget/WidgetHostHandler.cs index 7503e4c..0c5d59a 100644 --- a/Hyperbar/Widgets/WidgetHostHandler.cs +++ b/Hyperbar.Widget/WidgetHostHandler.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetHostHandler(IMediator mediator, IFactory factory) : @@ -12,8 +12,8 @@ public class WidgetHostHandler(IMediator mediator, { if (factory.Create(host) is WidgetContainerViewModel containerViewModel) { - await mediator.PublishAsync(new Created(containerViewModel), nameof(WidgetBarViewModel), - cancellationToken); + await mediator.PublishAsync(new Created(containerViewModel), + nameof(WidgetBarViewModel), cancellationToken); } } } diff --git a/Hyperbar/Widgets/WidgetManager.cs b/Hyperbar.Widget/WidgetManager.cs similarity index 87% rename from Hyperbar/Widgets/WidgetManager.cs rename to Hyperbar.Widget/WidgetManager.cs index 538c9f5..37d6029 100644 --- a/Hyperbar/Widgets/WidgetManager.cs +++ b/Hyperbar.Widget/WidgetManager.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetInitializer(IMediator mediator) : IInitializer diff --git a/Hyperbar/Views/WidgetMenuViewModel.cs b/Hyperbar.Widget/WidgetMenuViewModel.cs similarity index 96% rename from Hyperbar/Views/WidgetMenuViewModel.cs rename to Hyperbar.Widget/WidgetMenuViewModel.cs index bf08730..2215470 100644 --- a/Hyperbar/Views/WidgetMenuViewModel.cs +++ b/Hyperbar.Widget/WidgetMenuViewModel.cs @@ -1,7 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -namespace Hyperbar; +namespace Hyperbar.Widget; [NotificationHandler(nameof(Id))] public partial class WidgetMenuViewModel(IServiceFactory serviceFactory, diff --git a/Hyperbar/Widgets/WidgetMonitor.cs b/Hyperbar.Widget/WidgetMonitor.cs similarity index 82% rename from Hyperbar/Widgets/WidgetMonitor.cs rename to Hyperbar.Widget/WidgetMonitor.cs index 57a73f6..1db1649 100644 --- a/Hyperbar/Widgets/WidgetMonitor.cs +++ b/Hyperbar.Widget/WidgetMonitor.cs @@ -1,4 +1,4 @@ -namespace Hyperbar; +namespace Hyperbar.Widget; public class WidgetMonitor : IInitializer diff --git a/Hyperbar/Widgets/WidgetService.cs b/Hyperbar.Widget/WidgetService.cs similarity index 94% rename from Hyperbar/Widgets/WidgetService.cs rename to Hyperbar.Widget/WidgetService.cs index f1ad9da..0e69b2b 100644 --- a/Hyperbar/Widgets/WidgetService.cs +++ b/Hyperbar.Widget/WidgetService.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Hosting; -namespace Hyperbar; +namespace Hyperbar.Widget; public sealed class WidgetService(IEnumerable initializers) : IHostedService diff --git a/Hyperbar/Views/WidgetSplitButtonViewModel.cs b/Hyperbar.Widget/WidgetSplitButtonViewModel.cs similarity index 96% rename from Hyperbar/Views/WidgetSplitButtonViewModel.cs rename to Hyperbar.Widget/WidgetSplitButtonViewModel.cs index 9a1dd89..99d6117 100644 --- a/Hyperbar/Views/WidgetSplitButtonViewModel.cs +++ b/Hyperbar.Widget/WidgetSplitButtonViewModel.cs @@ -1,7 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -namespace Hyperbar; +namespace Hyperbar.Widget; [NotificationHandler(nameof(Id))] public partial class WidgetSplitButtonViewModel(IServiceFactory serviceFactory, diff --git a/Hyperbar.Widget/WidgetViewModelEnumerator.cs b/Hyperbar.Widget/WidgetViewModelEnumerator.cs new file mode 100644 index 0000000..e7d243a --- /dev/null +++ b/Hyperbar.Widget/WidgetViewModelEnumerator.cs @@ -0,0 +1,11 @@ +namespace Hyperbar.Widget; + +public class WidgetViewModelEnumerator : + INotificationHandler> +{ + public Task Handle(Enumerate notification, + CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Hyperbar.Windows.Contextual/Hyperbar.Widget.Contextual.csproj b/Hyperbar.Windows.Contextual/Hyperbar.Widget.Contextual.csproj index 4a8f052..0543aaa 100644 --- a/Hyperbar.Windows.Contextual/Hyperbar.Widget.Contextual.csproj +++ b/Hyperbar.Windows.Contextual/Hyperbar.Widget.Contextual.csproj @@ -9,6 +9,7 @@ + diff --git a/Hyperbar.Windows.MediaController/Hyperbar.Windows.MediaController.csproj b/Hyperbar.Windows.MediaController/Hyperbar.Windows.MediaController.csproj index 229b8f3..ae10de8 100644 --- a/Hyperbar.Windows.MediaController/Hyperbar.Windows.MediaController.csproj +++ b/Hyperbar.Windows.MediaController/Hyperbar.Windows.MediaController.csproj @@ -18,6 +18,7 @@ + diff --git a/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerWidget.cs b/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerWidget.cs index 3f0ee59..10de475 100644 --- a/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerWidget.cs +++ b/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerWidget.cs @@ -1,3 +1,4 @@ +using Hyperbar.Widget; using Microsoft.Extensions.DependencyInjection; using Windows.Media.Control; diff --git a/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerWidgetConfiguration.cs b/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerWidgetConfiguration.cs index d25b286..28a34f3 100644 --- a/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerWidgetConfiguration.cs +++ b/Hyperbar.Windows.MediaController/Lifecycles/MediaControllerWidgetConfiguration.cs @@ -1,4 +1,6 @@ -namespace Hyperbar.Windows.MediaController; +using Hyperbar.Widget; + +namespace Hyperbar.Windows.MediaController; public class MediaControllerWidgetConfiguration : WidgetConfiguration diff --git a/Hyperbar.Windows.MediaController/Views/MediaButtonViewModel.cs b/Hyperbar.Windows.MediaController/Views/MediaButtonViewModel.cs index aafbcbd..46b558a 100644 --- a/Hyperbar.Windows.MediaController/Views/MediaButtonViewModel.cs +++ b/Hyperbar.Windows.MediaController/Views/MediaButtonViewModel.cs @@ -1,4 +1,5 @@ using CommunityToolkit.Mvvm.Input; +using Hyperbar.Widget; using System.Windows.Input; namespace Hyperbar.Windows.MediaController; diff --git a/Hyperbar.Windows.MediaController/Views/MediaControllerViewModel.cs b/Hyperbar.Windows.MediaController/Views/MediaControllerViewModel.cs index ae4ca69..6e4afb3 100644 --- a/Hyperbar.Windows.MediaController/Views/MediaControllerViewModel.cs +++ b/Hyperbar.Windows.MediaController/Views/MediaControllerViewModel.cs @@ -1,4 +1,5 @@ using CommunityToolkit.Mvvm.Input; +using Hyperbar.Widget; namespace Hyperbar.Windows.MediaController; diff --git a/Hyperbar.Windows.MediaController/Views/MediaControllerWidgetViewModel.cs b/Hyperbar.Windows.MediaController/Views/MediaControllerWidgetViewModel.cs index c51a45b..1a2d54d 100644 --- a/Hyperbar.Windows.MediaController/Views/MediaControllerWidgetViewModel.cs +++ b/Hyperbar.Windows.MediaController/Views/MediaControllerWidgetViewModel.cs @@ -1,4 +1,6 @@ -namespace Hyperbar.Windows.MediaController; +using Hyperbar.Widget; + +namespace Hyperbar.Windows.MediaController; public class MediaControllerWidgetViewModel(ITemplateFactory templateFactory, IServiceFactory serviceFactory, diff --git a/Hyperbar.Windows.MediaController/Views/MediaInformationViewModel.cs b/Hyperbar.Windows.MediaController/Views/MediaInformationViewModel.cs index da0dec7..7782320 100644 --- a/Hyperbar.Windows.MediaController/Views/MediaInformationViewModel.cs +++ b/Hyperbar.Windows.MediaController/Views/MediaInformationViewModel.cs @@ -1,5 +1,6 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; +using Hyperbar.Widget; using System.Windows.Input; namespace Hyperbar.Windows.MediaController; diff --git a/Hyperbar.Windows.Primary/Hyperbar.Widget.Primary.csproj b/Hyperbar.Windows.Primary/Hyperbar.Widget.Primary.csproj index b84d4ea..459e51f 100644 --- a/Hyperbar.Windows.Primary/Hyperbar.Widget.Primary.csproj +++ b/Hyperbar.Windows.Primary/Hyperbar.Widget.Primary.csproj @@ -10,6 +10,7 @@ + diff --git a/Hyperbar.Windows.Primary/PrimaryWidget.cs b/Hyperbar.Windows.Primary/PrimaryWidget.cs index ef6d59c..8fd4f5b 100644 --- a/Hyperbar.Windows.Primary/PrimaryWidget.cs +++ b/Hyperbar.Windows.Primary/PrimaryWidget.cs @@ -1,3 +1,4 @@ +using Hyperbar.Widget; using Microsoft.Extensions.DependencyInjection; namespace Hyperbar.Windows.Primary; diff --git a/Hyperbar.Windows.Primary/PrimaryWidgetConfiguration.cs b/Hyperbar.Windows.Primary/PrimaryWidgetConfiguration.cs index a38afb7..458f9a5 100644 --- a/Hyperbar.Windows.Primary/PrimaryWidgetConfiguration.cs +++ b/Hyperbar.Windows.Primary/PrimaryWidgetConfiguration.cs @@ -1,6 +1,9 @@ -namespace Hyperbar.Windows.Primary; +using Hyperbar.Widget; -public class PrimaryWidgetConfiguration : WidgetConfiguration +namespace Hyperbar.Windows.Primary; + +public class PrimaryWidgetConfiguration : + WidgetConfiguration { public List Commands { get; set; } = []; } \ No newline at end of file diff --git a/Hyperbar.Windows.Primary/PrimaryWidgetConfigurationHandler.cs b/Hyperbar.Windows.Primary/PrimaryWidgetConfigurationHandler.cs index 3f6bf47..3a611db 100644 --- a/Hyperbar.Windows.Primary/PrimaryWidgetConfigurationHandler.cs +++ b/Hyperbar.Windows.Primary/PrimaryWidgetConfigurationHandler.cs @@ -1,4 +1,6 @@ -namespace Hyperbar.Windows.Primary; +using Hyperbar.Widget; + +namespace Hyperbar.Windows.Primary; public class PrimaryWidgetConfigurationHandler(IMediator mediator, PrimaryWidgetConfiguration configuration, diff --git a/Hyperbar.Windows.Primary/PrimaryWidgetViewModel.cs b/Hyperbar.Windows.Primary/PrimaryWidgetViewModel.cs index 8113be3..d6c507e 100644 --- a/Hyperbar.Windows.Primary/PrimaryWidgetViewModel.cs +++ b/Hyperbar.Windows.Primary/PrimaryWidgetViewModel.cs @@ -1,4 +1,6 @@ -namespace Hyperbar.Windows.Primary; +using Hyperbar.Widget; + +namespace Hyperbar.Windows.Primary; [NotificationHandler(nameof(PrimaryWidgetViewModel))] public class PrimaryWidgetViewModel(ITemplateFactory templateFactory, diff --git a/Hyperbar.Windows.Primary/WidgetComponentEnumerationHandler.cs b/Hyperbar.Windows.Primary/WidgetComponentEnumerationHandler.cs index 3220fa4..e73375a 100644 --- a/Hyperbar.Windows.Primary/WidgetComponentEnumerationHandler.cs +++ b/Hyperbar.Windows.Primary/WidgetComponentEnumerationHandler.cs @@ -1,4 +1,6 @@ -namespace Hyperbar.Windows.Primary; +using Hyperbar.Widget; + +namespace Hyperbar.Windows.Primary; public class WidgetComponentEnumerationHandler(PrimaryWidgetConfiguration configuration, IFactory factory, diff --git a/Hyperbar.Windows.Primary/WidgetComponentFactory.cs b/Hyperbar.Windows.Primary/WidgetComponentFactory.cs index 574112f..c2513ed 100644 --- a/Hyperbar.Windows.Primary/WidgetComponentFactory.cs +++ b/Hyperbar.Windows.Primary/WidgetComponentFactory.cs @@ -1,4 +1,5 @@ using CommunityToolkit.Mvvm.Input; +using Hyperbar.Widget; namespace Hyperbar.Windows.Primary; diff --git a/Hyperbar.Windows.Primary/WidgetComponentProvider.cs b/Hyperbar.Windows.Primary/WidgetComponentProvider.cs index fec537c..964eb2f 100644 --- a/Hyperbar.Windows.Primary/WidgetComponentProvider.cs +++ b/Hyperbar.Windows.Primary/WidgetComponentProvider.cs @@ -1,4 +1,6 @@ -namespace Hyperbar.Windows.Primary; +using Hyperbar.Widget; + +namespace Hyperbar.Windows.Primary; public class WidgetComponentProvider(ICache cache) : IProvider diff --git a/Hyperbar.Windows/App.xaml.cs b/Hyperbar.Windows/App.xaml.cs index 4059fa5..046c19b 100644 --- a/Hyperbar.Windows/App.xaml.cs +++ b/Hyperbar.Windows/App.xaml.cs @@ -1,4 +1,5 @@ -using Hyperbar.Windows.Controls; +using Hyperbar.Widget; +using Hyperbar.Windows.Controls; using Hyperbar.Windows.Interop; using Hyperbar.Windows.UI; using Microsoft.Extensions.Configuration; diff --git a/Hyperbar.Windows/Hyperbar.Windows.csproj b/Hyperbar.Windows/Hyperbar.Windows.csproj index 0e35a3b..c66b2fc 100644 --- a/Hyperbar.Windows/Hyperbar.Windows.csproj +++ b/Hyperbar.Windows/Hyperbar.Windows.csproj @@ -44,6 +44,7 @@ true + diff --git a/Hyperbar.Windows/Lifecycles/AppInitializer.cs b/Hyperbar.Windows/Lifecycles/AppInitializer.cs index 4cd3176..fdc2a3e 100644 --- a/Hyperbar.Windows/Lifecycles/AppInitializer.cs +++ b/Hyperbar.Windows/Lifecycles/AppInitializer.cs @@ -1,4 +1,5 @@ -using Hyperbar.Windows.Controls; +using Hyperbar.Widget; +using Hyperbar.Windows.Controls; using Microsoft.Extensions.DependencyInjection; namespace Hyperbar.Windows; diff --git a/Hyperbar.Windows/Views/WidgetView.xaml.cs b/Hyperbar.Windows/Views/WidgetView.xaml.cs index d77a38f..54d5dfc 100644 --- a/Hyperbar.Windows/Views/WidgetView.xaml.cs +++ b/Hyperbar.Windows/Views/WidgetView.xaml.cs @@ -1,3 +1,4 @@ +using Hyperbar.Widget; using Microsoft.UI.Xaml.Controls; namespace Hyperbar.Windows; diff --git a/Hyperbar.sln b/Hyperbar.sln index db6b6b0..b320946 100644 --- a/Hyperbar.sln +++ b/Hyperbar.sln @@ -17,7 +17,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperbar.Windows.UI", "Hype EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperbar.Windows.Interop", "Hyperbar.Windows.Interop\Hyperbar.Windows.Interop.csproj", "{7263FB8C-4007-4581-8AD7-DCAB2AD7C444}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyperbar.Windows.MediaController", "Hyperbar.Windows.MediaController\Hyperbar.Windows.MediaController.csproj", "{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperbar.Windows.MediaController", "Hyperbar.Windows.MediaController\Hyperbar.Windows.MediaController.csproj", "{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyperbar.Widget", "Hyperbar.Widget\Hyperbar.Widget.csproj", "{D38F95E6-744B-45DB-AF67-F331FB73615A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -167,6 +169,22 @@ Global {88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Release|x64.Build.0 = Release|Any CPU {88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Release|x86.ActiveCfg = Release|Any CPU {88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Release|x86.Build.0 = Release|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Debug|ARM64.Build.0 = Debug|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Debug|x64.ActiveCfg = Debug|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Debug|x64.Build.0 = Debug|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Debug|x86.Build.0 = Debug|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Release|Any CPU.Build.0 = Release|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Release|ARM64.ActiveCfg = Release|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Release|ARM64.Build.0 = Release|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Release|x64.ActiveCfg = Release|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Release|x64.Build.0 = Release|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Release|x86.ActiveCfg = Release|Any CPU + {D38F95E6-744B-45DB-AF67-F331FB73615A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Hyperbar/Extensions/IServiceCollectionExtensions.cs b/Hyperbar/Extensions/IServiceCollectionExtensions.cs index ff9674f..b166143 100644 --- a/Hyperbar/Extensions/IServiceCollectionExtensions.cs +++ b/Hyperbar/Extensions/IServiceCollectionExtensions.cs @@ -149,18 +149,9 @@ public static class IServiceCollectionExtensions services.AddSingleton(); - services.AddTransient(); - services.AddTransient, WidgetFactory>(); - - services.AddHandler(); - services.AddHandler(); - services.AddHandler(); - services.AddHandler(); - - services.AddTransient, WidgetContainerFactory>(); - return services; } + public static IServiceCollection AddHandler(this IServiceCollection services, ServiceLifetime lifetime = ServiceLifetime.Transient) where THandler : @@ -225,44 +216,4 @@ public static class IServiceCollectionExtensions return services; } - - public static IServiceCollection AddWidgetTemplate(this IServiceCollection services) - where TWidgetContent : - IWidgetViewModel - { - Type contentType = typeof(TWidgetContent); - Type templateType = typeof(IWidgetView); - - string key = contentType.Name; - - services.AddTransient(typeof(IWidgetViewModel), contentType); - services.TryAddTransient(templateType, provider => provider.GetService()!); - - services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType); - services.TryAddKeyedTransient(key, (provider, key) => provider.GetService()!); - - services.AddTransient(provider => new ContentTemplateDescriptor { ContentType = contentType, TemplateType = templateType, Key = key }); - - return services; - } - - public static IServiceCollection AddWidgetTemplate(this IServiceCollection services) - where TWidgetContent : - IWidgetViewModel - { - Type contentType = typeof(TWidgetContent); - Type templateType = typeof(TWidgetTemplate); - - string key = contentType.Name; - - services.AddTransient(typeof(IWidgetViewModel), contentType); - services.TryAddTransient(templateType); - - services.AddKeyedTransient(typeof(IWidgetViewModel), key, contentType); - services.TryAddKeyedTransient(templateType, key); - - services.AddTransient(provider => new ContentTemplateDescriptor { ContentType = contentType, TemplateType = templateType, Key = key }); - - return services; - } } \ No newline at end of file diff --git a/Hyperbar/Views/IEnumerator.cs b/Hyperbar/Lifecycles/IEnumerator.cs similarity index 100% rename from Hyperbar/Views/IEnumerator.cs rename to Hyperbar/Lifecycles/IEnumerator.cs diff --git a/Hyperbar/Views/IInitialization.cs b/Hyperbar/Lifecycles/IInitialization.cs similarity index 100% rename from Hyperbar/Views/IInitialization.cs rename to Hyperbar/Lifecycles/IInitialization.cs diff --git a/Hyperbar/Views/IObservableCollectionViewModel.cs b/Hyperbar/Lifecycles/IObservableCollectionViewModel.cs similarity index 100% rename from Hyperbar/Views/IObservableCollectionViewModel.cs rename to Hyperbar/Lifecycles/IObservableCollectionViewModel.cs diff --git a/Hyperbar/Views/ObservableCollectionViewModel.cs b/Hyperbar/Lifecycles/ObservableCollectionViewModel.cs similarity index 100% rename from Hyperbar/Views/ObservableCollectionViewModel.cs rename to Hyperbar/Lifecycles/ObservableCollectionViewModel.cs diff --git a/Hyperbar/Views/ObservableViewModel.cs b/Hyperbar/Lifecycles/ObservableViewModel.cs similarity index 100% rename from Hyperbar/Views/ObservableViewModel.cs rename to Hyperbar/Lifecycles/ObservableViewModel.cs