Started layout editor implementation

Rearranged VMs/Views
Updated RGB.NET
This commit is contained in:
SpoinkyNL committed 2019-08-11 01:23:13 +02:00
1 parent 390dcc6ae1
commit 6e23c079b1
52 files changed
+741 -185

No files matched your search

@@ -0,0 +1,33 @@
<UserControl x:Class="Artemis.UI.Views.Controls.Editor.SurfaceEditorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:editor="clr-namespace:Artemis.UI.ViewModels.Controls.Editor"
xmlns:xaml="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DesignHeight="450"
d:DesignWidth="800"
d:DataContext="{d:DesignInstance editor:SurfaceEditorViewModel}">
<Grid>
<TextBlock>Surface editor view</TextBlock>
<ItemsControl ItemsSource="{Binding Devices}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding Device.Location.X}" />
<Setter Property="Canvas.Top" Value="{Binding Device.Location.Y}" />
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Width="{Binding Device.Size.Width}" Height="{Binding Device.Size.Height}" xaml:View.Model="{Binding }"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</UserControl>
@@ -0,0 +1,31 @@
<UserControl x:Class="Artemis.UI.Views.Controls.RgbDevice.RgbDeviceView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:rgbDevice="clr-namespace:Artemis.UI.ViewModels.Controls.RgbDevice"
xmlns:xaml="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance rgbDevice:RgbDeviceViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<ItemsControl ItemsSource="{Binding Leds}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding Led.LedRectangle.X}" />
<Setter Property="Canvas.Top" Value="{Binding Led.LedRectangle.Y}" />
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Width="{Binding Led.LedRectangle.Width}" Height="{Binding Led.LedRectangle.Width}" xaml:View.Model="{Binding}" ToolTip="{Binding Tooltip}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</UserControl>
@@ -0,0 +1,12 @@
<UserControl x:Class="Artemis.UI.Views.Controls.RgbDevice.RgbLedView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.UI.Views.Controls.RgbDevice"
xmlns:rgbDevice="clr-namespace:Artemis.UI.ViewModels.Controls.RgbDevice"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance rgbDevice:RgbLedViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<Image Width="Auto" Height="Auto" Source="{Binding DisplayDrawing}" Margin="2" />
</UserControl>
@@ -1,10 +1,10 @@
<UserControl x:Class="Artemis.UI.Views.Settings.DeviceSettingsView"
<UserControl x:Class="Artemis.UI.Views.Controls.Settings.RgbDeviceSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vms="clr-namespace:Artemis.UI.ViewModels.Settings"
d:DataContext="{d:DesignInstance vms:DeviceSettingsViewModel}"
xmlns:settings="clr-namespace:Artemis.UI.ViewModels.Controls.Settings"
d:DataContext="{d:DesignInstance settings:RgbDeviceSettingsViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
@@ -0,0 +1,23 @@
<UserControl x:Class="Artemis.UI.Views.Screens.EditorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
xmlns:xaml="https://github.com/canton7/Stylet"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance screens:EditorViewModel}"
d:DesignHeight="600" d:DesignWidth="600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<StackPanel Margin="16">
<TextBlock>In the editor you can either edit your surface layout or edit a profile.</TextBlock>
<ContentControl xaml:View.Model="{Binding SurfaceEditorViewModel}"/>
</StackPanel>
</UserControl>
@@ -1,4 +1,4 @@
<UserControl x:Class="Artemis.UI.Views.HomeView"
<UserControl x:Class="Artemis.UI.Views.Screens.HomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="https://github.com/canton7/Stylet"
@@ -6,10 +6,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vms="clr-namespace:Artemis.UI.ViewModels"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
mc:Ignorable="d"
d:DesignHeight="574.026"
d:DesignWidth="1029.87"
d:DataContext="{d:DesignInstance vms:HomeViewModel, IsDesignTimeCreatable=True}">
d:DataContext="{d:DesignInstance screens:HomeViewModel, IsDesignTimeCreatable=True}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@@ -1,4 +1,4 @@
<metro:MetroWindow x:Class="Artemis.UI.Views.RootView"
<metro:MetroWindow x:Class="Artemis.UI.Views.Screens.RootView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -10,13 +10,14 @@
xmlns:models="clr-namespace:Artemis.Core.Plugins.Models;assembly=Artemis.Core"
xmlns:interfaces="clr-namespace:Artemis.Core.Plugins.Interfaces;assembly=Artemis.Core"
xmlns:abstract="clr-namespace:Artemis.Core.Plugins.Abstract;assembly=Artemis.Core"
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
mc:Ignorable="d"
GlowBrush="{DynamicResource AccentColorBrush}"
FontFamily="{StaticResource DefaultFont}"
Title="Artemis"
d:DesignHeight="639.411"
d:DesignWidth="1113.251"
d:DataContext="{d:DesignInstance vms:RootViewModel}"
d:DataContext="{d:DesignInstance screens:RootViewModel}"
Icon="/Artemis.UI;component/Resources/logo-512.png">
<metro:MetroWindow.Resources>
<DrawingImage x:Key="BowIcon">
@@ -106,6 +107,13 @@
<TextBlock>Workshop</TextBlock>
</StackPanel>
</ListBoxItem>
<ListBoxItem x:Name="Editor">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Edit"
Margin="0,0,8,0" />
<TextBlock>Editor</TextBlock>
</StackPanel>
</ListBoxItem>
<ListBoxItem x:Name="Settings">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Settings"
@@ -1,11 +1,12 @@
<UserControl x:Class="Artemis.UI.Views.Settings.SettingsView"
<UserControl x:Class="Artemis.UI.Views.Screens.SettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
xmlns:xaml="https://github.com/canton7/Stylet"
mc:Ignorable="d"
xmlns:vms="clr-namespace:Artemis.UI.ViewModels.Settings"
d:DataContext="{d:DesignInstance vms:SettingsViewModel}"
d:DataContext="{d:DesignInstance screens:SettingsViewModel}"
d:DesignHeight="600" d:DesignWidth="600">
<UserControl.Resources>
<ResourceDictionary>
@@ -23,7 +24,14 @@
<TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}">Devices</TextBlock>
<Grid>
<TextBlock>A list of plugins and options to disable them</TextBlock>
<TextBlock>A list of devices and options to disable them</TextBlock>
<ItemsControl ItemsSource="{Binding DeviceSettingsViewModels}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl xaml:View.Model="{Binding}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
<TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}">Plugins</TextBlock>