wrapped custom widget items in containers so we have more control of the surrounding, i.e. divider
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||||
|
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||||
|
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
|
||||||
|
<UseWinUI>true</UseWinUI>
|
||||||
|
<UseRidGraph>true</UseRidGraph>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="MediaControllerView.xaml" />
|
||||||
|
<None Remove="MediaControllerWidgetView.xaml" />
|
||||||
|
<None Remove="MediaInformationView.xaml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230913002" />
|
||||||
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Hyperbar.Windows.UI\Hyperbar.Windows.UI.csproj" />
|
||||||
|
<ProjectReference Include="..\Hyperbar\Hyperbar.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="MediaInformationView.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="MediaControllerView.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="MediaControllerWidgetView.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Hyperbar.Windows.Primary;
|
||||||
|
|
||||||
|
public class MediaController :
|
||||||
|
IInitializer
|
||||||
|
{
|
||||||
|
public Task InitializeAsync()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Hyperbar.Windows.CommandView"
|
x:Class="Hyperbar.Windows.MediaController.MediaControllerView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:windows="using:Hyperbar.Windows">
|
xmlns:ui="using:Hyperbar.Windows.UI">
|
||||||
<ItemsControl ItemTemplateSelector="{Binding Mode=TwoWay, Converter={windows:DataTemplateConverter}}" ItemsSource="{Binding}">
|
<ItemsControl ItemTemplateSelector="{Binding Mode=TwoWay, Converter={ui:DataTemplateConverter}}" ItemsSource="{Binding}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<StackPanel Orientation="Horizontal" />
|
<StackPanel Orientation="Horizontal" />
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace Hyperbar.Windows.MediaController;
|
||||||
|
|
||||||
|
public sealed partial class MediaControllerView :
|
||||||
|
UserControl
|
||||||
|
{
|
||||||
|
public MediaControllerView() => InitializeComponent();
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace Hyperbar.Windows.Primary;
|
||||||
|
|
||||||
|
public partial class MediaInformationViewModel :
|
||||||
|
WidgetComponentViewModel
|
||||||
|
{
|
||||||
|
[ObservableProperty]
|
||||||
|
private string title = "this is a test";
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private string description = "this is a test description";
|
||||||
|
|
||||||
|
public MediaInformationViewModel(ITemplateFactory templateFactory) : base(templateFactory)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MediaControllerViewModel :
|
||||||
|
ObservableCollectionViewModel<WidgetComponentViewModel>,
|
||||||
|
ITemplatedViewModel
|
||||||
|
{
|
||||||
|
public MediaControllerViewModel(ITemplateFactory templateFactory,
|
||||||
|
IServiceFactory serviceFactory,
|
||||||
|
IMediator mediator) : base(serviceFactory, mediator)
|
||||||
|
{
|
||||||
|
TemplateFactory = templateFactory;
|
||||||
|
|
||||||
|
this.Add<MediaInformationViewModel>();
|
||||||
|
this.Add<WidgetButtonViewModel>("\uEB9E");
|
||||||
|
this.Add<WidgetButtonViewModel>("\uE768");
|
||||||
|
this.Add<WidgetButtonViewModel>("\uE769");
|
||||||
|
this.Add<WidgetButtonViewModel>("\uEB9D");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ITemplateFactory TemplateFactory { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using Hyperbar.Windows.MediaController;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
|
namespace Hyperbar.Windows.Primary;
|
||||||
|
|
||||||
|
public class MediaControllerWidgetProvider :
|
||||||
|
IWidgetProvider
|
||||||
|
{
|
||||||
|
public void Create(HostBuilderContext comtext, IServiceCollection services) =>
|
||||||
|
services.AddWidgetTemplate<MediaControllerWidgetViewModel, MediaControllerWidgetView>()
|
||||||
|
.AddContentTemplate<MediaControllerViewModel, MediaControllerView>()
|
||||||
|
.AddContentTemplate<MediaControllerViewModel, MediaControllerView>()
|
||||||
|
.AddContentTemplate<MediaControllerViewModel, MediaControllerView>()
|
||||||
|
.AddContentTemplate<MediaInformationViewModel, MediaInformationView>();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="Hyperbar.Windows.MediaController.MediaControllerWidgetView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:ui="using:Hyperbar.Windows.UI">
|
||||||
|
<FlipView
|
||||||
|
x:Name="FlipView"
|
||||||
|
Width="320"
|
||||||
|
Background="Transparent"
|
||||||
|
ItemTemplateSelector="{Binding Converter={ui:DataTemplateConverter}}"
|
||||||
|
ItemsSource="{Binding}">
|
||||||
|
<FlipView.ItemContainerStyle>
|
||||||
|
<Style TargetType="FlipViewItem">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Right" />
|
||||||
|
|
||||||
|
</Style>
|
||||||
|
</FlipView.ItemContainerStyle>
|
||||||
|
<FlipView.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel AreScrollSnapPointsRegular="False" Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</FlipView.ItemsPanel>
|
||||||
|
</FlipView>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
namespace Hyperbar.Windows.MediaController;
|
||||||
|
|
||||||
|
public sealed partial class MediaControllerWidgetView :
|
||||||
|
UserControl
|
||||||
|
{
|
||||||
|
public MediaControllerWidgetView() => InitializeComponent();
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
namespace Hyperbar.Windows.Primary;
|
||||||
|
|
||||||
|
public class MediaControllerWidgetViewModel(ITemplateFactory templateFactory,
|
||||||
|
IServiceFactory serviceFactory,
|
||||||
|
IMediator mediator,
|
||||||
|
IEnumerable<MediaControllerViewModel> items) :
|
||||||
|
ObservableCollectionViewModel<MediaControllerViewModel>(serviceFactory, mediator, items),
|
||||||
|
IWidgetViewModel,
|
||||||
|
ITemplatedViewModel
|
||||||
|
{
|
||||||
|
public ITemplateFactory TemplateFactory => templateFactory;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="Hyperbar.Windows.MediaController.MediaInformationView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<Button>sdfsdf</Button>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace Hyperbar.Windows.MediaController;
|
||||||
|
|
||||||
|
public sealed partial class MediaInformationView :
|
||||||
|
UserControl
|
||||||
|
{
|
||||||
|
public MediaInformationView() => InitializeComponent();
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Hyperbar\Hyperbar.csproj" />
|
<ProjectReference Include="..\Hyperbar\Hyperbar.csproj" />
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
|
|
||||||
namespace Hyperbar.Windows.Primary;
|
namespace Hyperbar.Windows.Primary;
|
||||||
|
|
||||||
public class PrimaryWidgetViewModel :
|
public class PrimaryWidgetViewModel(ITemplateFactory templateFactory,
|
||||||
ObservableCollectionViewModel<IWidgetComponentViewModel>,
|
IServiceFactory serviceFactory,
|
||||||
|
IMediator mediator,
|
||||||
|
IEnumerable<IWidgetComponentViewModel> items) :
|
||||||
|
ObservableCollectionViewModel<IWidgetComponentViewModel>(serviceFactory, mediator, items),
|
||||||
IWidgetViewModel,
|
IWidgetViewModel,
|
||||||
ITemplatedViewModel
|
ITemplatedViewModel
|
||||||
{
|
{
|
||||||
public PrimaryWidgetViewModel(ITemplateFactory templateFactory,
|
public ITemplateFactory TemplateFactory => templateFactory;
|
||||||
IServiceFactory serviceFactory,
|
|
||||||
IMediator mediator,
|
|
||||||
IEnumerable<IWidgetComponentViewModel> items) : base(serviceFactory, mediator, items)
|
|
||||||
{
|
|
||||||
TemplateFactory = templateFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ITemplateFactory TemplateFactory { get; }
|
|
||||||
}
|
}
|
||||||
@@ -14,5 +14,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Hyperbar.Windows.Interop\Hyperbar.Windows.Interop.csproj" />
|
<ProjectReference Include="..\Hyperbar.Windows.Interop\Hyperbar.Windows.Interop.csproj" />
|
||||||
|
<ProjectReference Include="..\Hyperbar\Hyperbar.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace Hyperbar.Windows.UI;
|
||||||
|
|
||||||
|
public class DataTemplateConverter :
|
||||||
|
ValueConverter<object, DataTemplateSelector>
|
||||||
|
{
|
||||||
|
protected override DataTemplateSelector? ConvertTo(object value,
|
||||||
|
Type? targetType,
|
||||||
|
object? parameter,
|
||||||
|
string? language)
|
||||||
|
{
|
||||||
|
return new TemplateGenerator();
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Hyperbar.Windows;
|
namespace Hyperbar.Windows.UI;
|
||||||
|
|
||||||
public class TemplateFactory(IEnumerable<IContentTemplateDescriptor> descriptors,
|
public class TemplateFactory(IEnumerable<IContentTemplateDescriptor> descriptors,
|
||||||
IServiceProvider provider) :
|
IServiceProvider provider) :
|
||||||
+5
-5
@@ -2,7 +2,7 @@
|
|||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.UI.Xaml.Markup;
|
using Microsoft.UI.Xaml.Markup;
|
||||||
|
|
||||||
namespace Hyperbar.Windows;
|
namespace Hyperbar.Windows.UI;
|
||||||
|
|
||||||
public class TemplateGenerator : DataTemplateSelector
|
public class TemplateGenerator : DataTemplateSelector
|
||||||
{
|
{
|
||||||
@@ -10,8 +10,8 @@ public class TemplateGenerator : DataTemplateSelector
|
|||||||
{
|
{
|
||||||
string xamlString = @"
|
string xamlString = @"
|
||||||
<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
|
<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
|
||||||
xmlns:desktop='using:Hyperbar.Windows'>
|
xmlns:ui='using:Hyperbar.Windows.UI'>
|
||||||
<desktop:TemplateGeneratorControl />
|
<ui:TemplateGeneratorControl />
|
||||||
</DataTemplate>";
|
</DataTemplate>";
|
||||||
|
|
||||||
return (DataTemplate)XamlReader.Load(xamlString);
|
return (DataTemplate)XamlReader.Load(xamlString);
|
||||||
@@ -21,8 +21,8 @@ public class TemplateGenerator : DataTemplateSelector
|
|||||||
{
|
{
|
||||||
string xamlString = @"
|
string xamlString = @"
|
||||||
<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
|
<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
|
||||||
xmlns:desktop='using:Hyperbar.Windows'>
|
xmlns:ui='using:Hyperbar.Windows.UI'>
|
||||||
<desktop:TemplateGeneratorControl />
|
<ui:TemplateGeneratorControl />
|
||||||
</DataTemplate>";
|
</DataTemplate>";
|
||||||
|
|
||||||
return (DataTemplate)XamlReader.Load(xamlString);
|
return (DataTemplate)XamlReader.Load(xamlString);
|
||||||
+5
-1
@@ -1,7 +1,7 @@
|
|||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
namespace Hyperbar.Windows;
|
namespace Hyperbar.Windows.UI;
|
||||||
|
|
||||||
public class TemplateGeneratorControl :
|
public class TemplateGeneratorControl :
|
||||||
ContentControl
|
ContentControl
|
||||||
@@ -17,5 +17,9 @@ public class TemplateGeneratorControl :
|
|||||||
{
|
{
|
||||||
Content = templatedViewModel.TemplateFactory.Create(DataContext.GetType().Name);
|
Content = templatedViewModel.TemplateFactory.Create(DataContext.GetType().Name);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
using Microsoft.UI.Xaml.Data;
|
using Microsoft.UI.Xaml.Data;
|
||||||
using Microsoft.UI.Xaml.Markup;
|
using Microsoft.UI.Xaml.Markup;
|
||||||
|
|
||||||
namespace Hyperbar.Windows;
|
namespace Hyperbar.Windows.UI;
|
||||||
|
|
||||||
public abstract class ValueConverter<TSource, TTarget> :
|
public abstract class ValueConverter<TSource, TTarget> :
|
||||||
MarkupExtension,
|
MarkupExtension,
|
||||||
@@ -3,14 +3,14 @@
|
|||||||
x:Class="Hyperbar.Windows.App"
|
x:Class="Hyperbar.Windows.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:desktop="using:Hyperbar.Windows">
|
xmlns:ui="using:Hyperbar.Windows.UI">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
<DataTemplate x:Key="DefaultDataTemplate">
|
<DataTemplate x:Key="DefaultDataTemplate">
|
||||||
<desktop:TemplateGeneratorControl />
|
<ui:TemplateGeneratorControl />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
using Hyperbar.Widget.Contextual;
|
using Hyperbar.Windows.Controls;
|
||||||
using Hyperbar.Windows.Controls;
|
|
||||||
using Hyperbar.Windows.Primary;
|
using Hyperbar.Windows.Primary;
|
||||||
|
using Hyperbar.Windows.UI;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using Microsoft.UI.Dispatching;
|
using Microsoft.UI.Dispatching;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace Hyperbar.Windows;
|
namespace Hyperbar.Windows;
|
||||||
|
|
||||||
@@ -44,21 +42,23 @@ public partial class App :
|
|||||||
services.AddTransient<ITemplateFactory, TemplateFactory>();
|
services.AddTransient<ITemplateFactory, TemplateFactory>();
|
||||||
|
|
||||||
services.AddTransient<DesktopFlyout>();
|
services.AddTransient<DesktopFlyout>();
|
||||||
services.AddContentTemplate<CommandViewModel, CommandView>();
|
|
||||||
|
|
||||||
// services.AddWidgetProvider<ContextualWidgetProvider>();
|
services.AddContentTemplate<WidgetBarViewModel, WidgetBarView>();
|
||||||
|
|
||||||
|
services.AddWidgetProvider<MediaControllerWidgetProvider>();
|
||||||
services.AddWidgetProvider<PrimaryWidgetProvider>();
|
services.AddWidgetProvider<PrimaryWidgetProvider>();
|
||||||
|
|
||||||
services.AddTransient(provider =>
|
services.AddTransient(provider =>
|
||||||
{
|
{
|
||||||
static IEnumerable<IWidgetViewModel> Resolve(IServiceProvider services)
|
static IEnumerable<WidgetContainerViewModel> Resolve(IServiceProvider services)
|
||||||
{
|
{
|
||||||
foreach (IWidgetContext widgetContext in services.GetServices<IWidgetContext>())
|
foreach (IWidgetContext widgetContext in services.GetServices<IWidgetContext>())
|
||||||
{
|
{
|
||||||
if (widgetContext.ServiceProvider.GetService<IWidgetViewModel>() is
|
if (widgetContext.ServiceProvider.GetServices<IWidgetViewModel>() is
|
||||||
IWidgetViewModel viewModel)
|
IEnumerable<IWidgetViewModel> viewModels)
|
||||||
{
|
{
|
||||||
yield return viewModel;
|
yield return (WidgetContainerViewModel)ActivatorUtilities.CreateInstance(widgetContext.ServiceProvider,
|
||||||
|
typeof(WidgetContainerViewModel), viewModels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Views\WidgetButtonView.xaml" />
|
<None Remove="Views\WidgetButtonView.xaml" />
|
||||||
|
<None Remove="Views\WidgetContainerView.xaml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||||
@@ -38,10 +39,16 @@
|
|||||||
<ProjectReference Include="..\Hyperbar.Windows.Contextual\Hyperbar.Widget.Contextual.csproj" />
|
<ProjectReference Include="..\Hyperbar.Windows.Contextual\Hyperbar.Widget.Contextual.csproj" />
|
||||||
<ProjectReference Include="..\Hyperbar.Windows.Controls\Hyperbar.Windows.Controls.csproj" />
|
<ProjectReference Include="..\Hyperbar.Windows.Controls\Hyperbar.Windows.Controls.csproj" />
|
||||||
<ProjectReference Include="..\Hyperbar.Windows.Interop\Hyperbar.Windows.Interop.csproj" />
|
<ProjectReference Include="..\Hyperbar.Windows.Interop\Hyperbar.Windows.Interop.csproj" />
|
||||||
|
<ProjectReference Include="..\Hyperbar.Windows.MediaController\Hyperbar.Windows.MediaController.csproj" />
|
||||||
<ProjectReference Include="..\Hyperbar.Windows.Primary\Hyperbar.Widget.Primary.csproj" />
|
<ProjectReference Include="..\Hyperbar.Windows.Primary\Hyperbar.Widget.Primary.csproj" />
|
||||||
<ProjectReference Include="..\Hyperbar.Windows.UI\Hyperbar.Windows.UI.csproj" />
|
<ProjectReference Include="..\Hyperbar.Windows.UI\Hyperbar.Windows.UI.csproj" />
|
||||||
<ProjectReference Include="..\Hyperbar\Hyperbar.csproj" />
|
<ProjectReference Include="..\Hyperbar\Hyperbar.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\WidgetContainerView.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="Views\WidgetButtonView.xaml">
|
<Page Update="Views\WidgetButtonView.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ using Microsoft.Extensions.DependencyInjection;
|
|||||||
|
|
||||||
namespace Hyperbar.Windows;
|
namespace Hyperbar.Windows;
|
||||||
|
|
||||||
public class AppInitializer([FromKeyedServices(nameof(CommandViewModel))] CommandView view,
|
public class AppInitializer([FromKeyedServices(nameof(WidgetBarViewModel))] WidgetBarView view,
|
||||||
[FromKeyedServices(nameof(CommandViewModel))] CommandViewModel viewModel,
|
[FromKeyedServices(nameof(WidgetBarViewModel))] WidgetBarViewModel viewModel,
|
||||||
DesktopFlyout desktopFlyout) :
|
DesktopFlyout desktopFlyout) :
|
||||||
IInitializer
|
IInitializer
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Hyperbar.Windows.Interop;
|
using Hyperbar.Windows.Interop;
|
||||||
using Hyperbar.Windows.Primary;
|
using Hyperbar.Windows.UI;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
@@ -28,20 +28,23 @@ namespace Hyperbar.Windows
|
|||||||
})
|
})
|
||||||
.ConfigureServices((context, isolatedServices) =>
|
.ConfigureServices((context, isolatedServices) =>
|
||||||
{
|
{
|
||||||
isolatedServices.AddHostedService<WidgetService>();
|
|
||||||
|
|
||||||
isolatedServices.AddSingleton<IServiceFactory>(provider =>
|
isolatedServices.AddSingleton<IServiceFactory>(provider =>
|
||||||
new ServiceFactory((type, parameters) => ActivatorUtilities.CreateInstance(provider, type, parameters!)));
|
new ServiceFactory((type, parameters) => ActivatorUtilities.CreateInstance(provider, type, parameters!)));
|
||||||
|
|
||||||
isolatedServices.AddSingleton<IVirtualKeyboard, VirtualKeyboard>();
|
isolatedServices.AddHostedService<WidgetService>();
|
||||||
|
|
||||||
isolatedServices.AddSingleton<IMediator, Mediator>();
|
|
||||||
isolatedServices.AddHandler<KeyAcceleratorHandler>();
|
|
||||||
isolatedServices.AddHandler<ProcesssAcceleratorHandler>();
|
|
||||||
isolatedServices.AddTransient<IWidgetView, WidgetView>();
|
|
||||||
isolatedServices.AddContentTemplate<WidgetButtonViewModel, WidgetButtonView>();
|
|
||||||
|
|
||||||
isolatedServices.AddTransient<ITemplateFactory, TemplateFactory>();
|
isolatedServices.AddTransient<ITemplateFactory, TemplateFactory>();
|
||||||
|
isolatedServices.AddSingleton<IMediator, Mediator>();
|
||||||
|
|
||||||
|
isolatedServices.AddSingleton<IVirtualKeyboard, VirtualKeyboard>();
|
||||||
|
|
||||||
|
isolatedServices.AddHandler<KeyAcceleratorHandler>();
|
||||||
|
isolatedServices.AddHandler<ProcesssAcceleratorHandler>();
|
||||||
|
|
||||||
|
isolatedServices.AddTransient<IWidgetView, WidgetView>();
|
||||||
|
|
||||||
|
isolatedServices.AddContentTemplate<WidgetContainerViewModel, WidgetContainerView>();
|
||||||
|
isolatedServices.AddContentTemplate<WidgetButtonViewModel, WidgetButtonView>();
|
||||||
|
|
||||||
builder.Create(context, isolatedServices);
|
builder.Create(context, isolatedServices);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
using Microsoft.UI.Xaml.Controls;
|
|
||||||
|
|
||||||
namespace Hyperbar.Windows;
|
|
||||||
|
|
||||||
public class DataTemplateConverter : ValueConverter<object, DataTemplateSelector>
|
|
||||||
{
|
|
||||||
protected override DataTemplateSelector? ConvertTo(object value, Type? targetType, object? parameter, string? language)
|
|
||||||
{
|
|
||||||
return new TemplateGenerator();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using Microsoft.UI.Xaml.Controls;
|
|
||||||
using Microsoft.UI.Xaml.Input;
|
|
||||||
|
|
||||||
namespace Hyperbar.Windows;
|
|
||||||
|
|
||||||
public sealed partial class CommandView :
|
|
||||||
UserControl
|
|
||||||
{
|
|
||||||
public CommandView() => InitializeComponent();
|
|
||||||
|
|
||||||
protected override void OnKeyDown(KeyRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnKeyDown(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
|
|
||||||
namespace Hyperbar.Windows;
|
|
||||||
|
|
||||||
public partial class CommandViewModel :
|
|
||||||
ObservableCollectionViewModel<IWidgetViewModel>,
|
|
||||||
ITemplatedViewModel
|
|
||||||
{
|
|
||||||
public CommandViewModel(ITemplateFactory templateFactory,
|
|
||||||
IServiceFactory serviceFactory,
|
|
||||||
IMediator mediator,
|
|
||||||
IEnumerable<IWidgetViewModel> items) : base(serviceFactory, mediator, items)
|
|
||||||
{
|
|
||||||
TemplateFactory = templateFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ITemplateFactory TemplateFactory { get; }
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="Hyperbar.Windows.WidgetBarView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:ui="using:Hyperbar.Windows.UI">
|
||||||
|
<ItemsControl ItemTemplateSelector="{Binding Converter={ui:DataTemplateConverter}}" ItemsSource="{Binding}">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
</ItemsControl>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace Hyperbar.Windows;
|
||||||
|
|
||||||
|
public sealed partial class WidgetBarView :
|
||||||
|
UserControl
|
||||||
|
{
|
||||||
|
public WidgetBarView() => InitializeComponent();
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="Hyperbar.Windows.WidgetContainerView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:ui="using:Hyperbar.Windows.UI">
|
||||||
|
<ItemsControl ItemTemplateSelector="{Binding Converter={ui:DataTemplateConverter}}" ItemsSource="{Binding}">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
</ItemsControl>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace Hyperbar.Windows;
|
||||||
|
|
||||||
|
public sealed partial class WidgetContainerView :
|
||||||
|
UserControl
|
||||||
|
{
|
||||||
|
public WidgetContainerView() => InitializeComponent();
|
||||||
|
}
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
x:Class="Hyperbar.Windows.WidgetView"
|
x:Class="Hyperbar.Windows.WidgetView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:windows="using:Hyperbar.Windows">
|
xmlns:ui="using:Hyperbar.Windows.UI">
|
||||||
<ItemsControl ItemTemplateSelector="{Binding Mode=TwoWay, Converter={windows:DataTemplateConverter}}" ItemsSource="{Binding}">
|
<ItemsControl ItemTemplateSelector="{Binding Converter={ui:DataTemplateConverter}}" ItemsSource="{Binding}">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8" />
|
<StackPanel Orientation="Horizontal" Spacing="8" />
|
||||||
|
|||||||
+19
-1
@@ -15,7 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperbar.Widget.Primary", "
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperbar.Windows.UI", "Hyperbar.Windows.UI\Hyperbar.Windows.UI.csproj", "{ED489968-89A5-42B5-9FC3-20DCF5D78A5E}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperbar.Windows.UI", "Hyperbar.Windows.UI\Hyperbar.Windows.UI.csproj", "{ED489968-89A5-42B5-9FC3-20DCF5D78A5E}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyperbar.Windows.Interop", "Hyperbar.Windows.Interop\Hyperbar.Windows.Interop.csproj", "{7263FB8C-4007-4581-8AD7-DCAB2AD7C444}"
|
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}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -149,6 +151,22 @@ Global
|
|||||||
{7263FB8C-4007-4581-8AD7-DCAB2AD7C444}.Release|x64.Build.0 = Release|Any CPU
|
{7263FB8C-4007-4581-8AD7-DCAB2AD7C444}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{7263FB8C-4007-4581-8AD7-DCAB2AD7C444}.Release|x86.ActiveCfg = Release|Any CPU
|
{7263FB8C-4007-4581-8AD7-DCAB2AD7C444}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{7263FB8C-4007-4581-8AD7-DCAB2AD7C444}.Release|x86.Build.0 = Release|Any CPU
|
{7263FB8C-4007-4581-8AD7-DCAB2AD7C444}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Debug|ARM64.Build.0 = Debug|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Release|ARM64.ActiveCfg = Release|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Release|ARM64.Build.0 = Release|Any CPU
|
||||||
|
{88C3EC90-C48C-47B9-89A8-740EFFFE5AAD}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{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
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public static class IServiceCollectionExtensions
|
|||||||
key ??= contentType.Name;
|
key ??= contentType.Name;
|
||||||
|
|
||||||
services.AddTransient(contentType);
|
services.AddTransient(contentType);
|
||||||
services.TryAddTransient(templateType);
|
services.AddTransient(templateType);
|
||||||
|
|
||||||
services.AddKeyedTransient(contentType, key);
|
services.AddKeyedTransient(contentType, key);
|
||||||
services.AddKeyedTransient(templateType, key);
|
services.AddKeyedTransient(templateType, key);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace Hyperbar;
|
|||||||
public class Mediator(IServiceProvider provider) :
|
public class Mediator(IServiceProvider provider) :
|
||||||
IMediator
|
IMediator
|
||||||
{
|
{
|
||||||
private readonly ConditionalWeakTable<Type, dynamic> addedHandlers = [];
|
private readonly List<KeyValuePair<Type, dynamic>> addedHandlers = [];
|
||||||
|
|
||||||
public ValueTask PublishAsync<TNotification>(TNotification notification,
|
public ValueTask PublishAsync<TNotification>(TNotification notification,
|
||||||
CancellationToken cancellationToken = default)
|
CancellationToken cancellationToken = default)
|
||||||
@@ -78,7 +78,7 @@ public class Mediator(IServiceProvider provider) :
|
|||||||
if (interfaceType.GetGenericArguments() is { Length: 1 } arguments)
|
if (interfaceType.GetGenericArguments() is { Length: 1 } arguments)
|
||||||
{
|
{
|
||||||
Type notificationType = arguments[0];
|
Type notificationType = arguments[0];
|
||||||
addedHandlers.Add(notificationType, subject);
|
addedHandlers.Add(new KeyValuePair<Type, dynamic>(notificationType, subject));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
namespace Hyperbar;
|
namespace Hyperbar;
|
||||||
|
|
||||||
public interface IWidgetComponentViewModel
|
public interface IWidgetComponentViewModel;
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
namespace Hyperbar;
|
namespace Hyperbar;
|
||||||
|
|
||||||
public interface IWidgetView
|
public interface IWidgetView;
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
namespace Hyperbar;
|
namespace Hyperbar;
|
||||||
|
|
||||||
public interface IWidgetViewModel
|
public interface IWidgetViewModel;
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
namespace Hyperbar;
|
namespace Hyperbar;
|
||||||
|
|
||||||
|
|
||||||
public class ObservableCollectionViewModel<TItem> :
|
public class ObservableCollectionViewModel<TItem> :
|
||||||
ObservableCollection<TItem>,
|
ObservableCollection<TItem>,
|
||||||
INotificationHandler<CollectionChanged<IEnumerable<TItem>>>
|
INotificationHandler<CollectionChanged<IEnumerable<TItem>>>
|
||||||
{
|
{
|
||||||
private readonly IServiceFactory serviceFactory;
|
private readonly IServiceFactory serviceFactory;
|
||||||
private SynchronizationContext? context;
|
private readonly SynchronizationContext? context;
|
||||||
|
|
||||||
public ObservableCollectionViewModel(IServiceFactory serviceFactory,
|
public ObservableCollectionViewModel(IServiceFactory serviceFactory,
|
||||||
IMediator mediator)
|
IMediator mediator)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
namespace Hyperbar;
|
||||||
|
|
||||||
|
public partial class WidgetBarViewModel(ITemplateFactory templateFactory,
|
||||||
|
IServiceFactory serviceFactory,
|
||||||
|
IMediator mediator,
|
||||||
|
IEnumerable<WidgetContainerViewModel> items) :
|
||||||
|
ObservableCollectionViewModel<WidgetContainerViewModel>(serviceFactory, mediator, items),
|
||||||
|
ITemplatedViewModel
|
||||||
|
{
|
||||||
|
public ITemplateFactory TemplateFactory => templateFactory;
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ using CommunityToolkit.Mvvm.Input;
|
|||||||
namespace Hyperbar;
|
namespace Hyperbar;
|
||||||
|
|
||||||
public partial class WidgetButtonViewModel :
|
public partial class WidgetButtonViewModel :
|
||||||
WidgetComponentViewModelBase
|
WidgetComponentViewModel
|
||||||
{
|
{
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private string? icon;
|
private string? icon;
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Hyperbar;
|
namespace Hyperbar;
|
||||||
|
|
||||||
public partial class WidgetComponentViewModelBase(ITemplateFactory templateFactory) :
|
public partial class WidgetComponentViewModel(ITemplateFactory templateFactory) :
|
||||||
ObservableObject,
|
ObservableObject,
|
||||||
IWidgetComponentViewModel,
|
IWidgetComponentViewModel,
|
||||||
ITemplatedViewModel
|
ITemplatedViewModel
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
namespace Hyperbar;
|
||||||
|
|
||||||
|
public class WidgetContainerViewModel(ITemplateFactory templateFactory,
|
||||||
|
IServiceFactory serviceFactory,
|
||||||
|
IMediator mediator,
|
||||||
|
IEnumerable<IWidgetViewModel> items) :
|
||||||
|
ObservableCollectionViewModel<IWidgetViewModel>(serviceFactory, mediator, items),
|
||||||
|
ITemplatedViewModel
|
||||||
|
{
|
||||||
|
public ITemplateFactory TemplateFactory => templateFactory;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user