Rename projects to better structure it. The aim is to try and keep it not dependant on the type of UI framework it uses thus allowing us to switch to another UI framework if we need later...
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Page
|
||||
x:Class="Hyperbar.Windows.CommandView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ItemsControl ItemTemplateSelector="{Binding TemplateFactory}" ItemsSource="{Binding}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</Page>
|
||||
@@ -0,0 +1,14 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
|
||||
namespace Hyperbar.Windows;
|
||||
|
||||
public sealed partial class CommandView : Page
|
||||
{
|
||||
public CommandView() => InitializeComponent();
|
||||
|
||||
protected override void OnKeyDown(KeyRoutedEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Hyperbar.Lifecycles;
|
||||
using Hyperbar.Templates;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Hyperbar.Windows;
|
||||
|
||||
public partial class CommandViewModel :
|
||||
ObservableCollectionViewModel,
|
||||
ITemplatedViewModel
|
||||
{
|
||||
public CommandViewModel(ITemplateFactory templateFactory,
|
||||
IEnumerable<ICommandWidgetViewModel> commands)
|
||||
{
|
||||
TemplateFactory = templateFactory;
|
||||
AddRange(commands);
|
||||
}
|
||||
|
||||
public ITemplateFactory TemplateFactory { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user