Implemented devices and LEDs in profile editor

This commit is contained in:
Robert committed 2019-11-12 14:03:18 +01:00
1 parent 83b9e5ce1a
commit 993ac1d595
13 files changed
+402 -49

No files matched your search

@@ -1,23 +1,34 @@
<UserControl
<UserControl x:Class="Artemis.UI.Views.Controls.ProfileEditor.ProfileDeviceView"
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:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:profileEditor="clr-namespace:Artemis.UI.ViewModels.Controls.ProfileEditor"
xmlns:Converters="clr-namespace:Artemis.UI.Converters" x:Class="Artemis.UI.Views.Controls.ProfileEditor.ProfileDeviceView"
xmlns:converters="clr-namespace:Artemis.UI.Converters"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance {x:Type profileEditor:ProfileDeviceViewModel}}"
d:DesignHeight="450" d:DesignWidth="800"
Cursor="{Binding Cursor}"
MouseEnter="{s:Action MouseEnter}"
MouseLeave="{s:Action MouseLeave}">
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<Converters:NullToImageConverter x:Key="NullToImageConverter"/>
<converters:NullToImageConverter x:Key="NullToImageConverter"/>
<converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
</UserControl.Resources>
<Grid>
<Image Source="{Binding Device.DeviceInfo.Image, Converter={StaticResource NullToImageConverter}}" />
<!-- Device image with fallback -->
<Image Source="{Binding Device.RgbDevice.DeviceInfo.Image, Converter={StaticResource NullToImageConverter}}" />
<Rectangle Fill="{DynamicResource ControlBackgroundBrush}"
Stroke="{DynamicResource ControlBorderBrush}"
StrokeThickness="1"
Visibility="{Binding Device.RgbDevice.DeviceInfo.Image, ConverterParameter=Inverted, Converter={StaticResource NullToVisibilityConverter}}" />
<TextBlock Text="{Binding Device.RgbDevice.DeviceInfo.DeviceName}"
Visibility="{Binding Device.RgbDevice.DeviceInfo.Image, ConverterParameter=Inverted, Converter={StaticResource NullToVisibilityConverter}}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TextWrapping="Wrap"
TextAlignment="Center" />
<!-- LEDs -->
<ItemsControl ItemsSource="{Binding Leds}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>