aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml
blob: 9ee2ffee7295bc6bdf32e88614824135a1e01a3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="ManagedEsent" version="1.9.4" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Common" version="2.4.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.CSharp" version="2.4.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.CSharp.Scripting" version="2.4.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="2.4.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Scripting" version="2.4.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Scripting.Common" version="2.4.0" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Workspaces.Common" version="2.4.0" targetFramework="net461" />
  <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
  <package id="System.AppContext" version="4.3.0" targetFramework="net461" />
  <package id="System.Collections" version="4.3.0" targetFramework="net461" />
  <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" />
  <package id="System.Collections.Immutable" version="1.3.1" targetFramework="net461" />
  <package id="System.Composition" version="1.0.31" targetFramework="net461" />
  <package id="System.Composition.AttributedModel" version="1.0.31" targetFramework="net461" />
  <package id="System.Composition.Convention" version="1.0.31" targetFramework="net461" />
  <package id="System.Composition.Hosting" version="1.0.31" targetFramework="net461" />
  <package id="System.Composition.Runtime" version="1.0.31" targetFramework="net461" />
  <package id="System.Composition.TypedParts" version="1.0.31" targetFramework="net461" />
  <package id="System.Console" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.FileVersionInfo" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.StackTrace" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" />
  <package id="System.Dynamic.Runtime" version="4.3.0" targetFramework="net461" />
  <package id="System.Globalization" version="4.3.0" targetFramework="net461" />
  <package id="System.IO" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" />
  <package id="System.Linq" version="4.3.0" targetFramework="net461" />
  <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
  <package id="System.Reflection" version="4.3.0" targetFramework="net461" />
  <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net461" />
  <package id="System.Reflection.Metadata" version="1.4.2" targetFramework="net461" />
  <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
  <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" />
  <package id="System.Text.Encoding.CodePages" version="4.3.0" targetFramework="net461" />
  <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Thread" version="4.3.0" targetFramework="net461" />
  <package id="System.ValueTuple" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XPath" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XPath.XDocument" version="4.3.0" targetFramework="net461" />
</packages>
ref='#n426'>426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477
<UserControl x:Class="Tango.MachineStudio.HardwareDesigner.Views.MainView"
             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:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:local="clr-namespace:Tango.MachineStudio.HardwareDesigner.Views"
             xmlns:vm="clr-namespace:Tango.MachineStudio.HardwareDesigner.ViewModels"
             xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             xmlns:global="clr-namespace:Tango.MachineStudio.HardwareDesigner"
             mc:Ignorable="d" 
             d:DesignHeight="2000" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">

    <UserControl.Resources>
        <converters:DoubleToIntConverter x:Key="DoubleToIntConverter" />
        <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" />

        <Style TargetType="ListBox" x:Key="typesList" BasedOn="{StaticResource {x:Type ListBox}}">
            <Setter Property="FontSize" Value="14"></Setter>
            <Setter Property="ItemContainerStyle">
                <Setter.Value>
                    <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
                        <Setter Property="FontWeight" Value="Normal"></Setter>
                        <Style.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter Property="FontWeight" Value="Bold"></Setter>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid>
        <Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="477*"/>
                    <ColumnDefinition Width="500"/>
                </Grid.ColumnDefinitions>

                <Grid>
                    <Grid Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="90"/>
                            <RowDefinition Height="631*"/>
                        </Grid.RowDefinitions>

                        <Grid Margin="0 0 0 0">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock FontSize="30" FontStyle="Italic" VerticalAlignment="Center" Margin="50 10 10 0" Foreground="Silver" FontWeight="Bold">HARDWARE DESIGNER</TextBlock>
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10 10 0 0">
                                    <materialDesign:PackIcon Kind="Pencil" Width="32" Height="32" Foreground="Silver" />
                                    <controls:SearchComboBox IsEnabled="{Binding IsFree}" ItemsSource="{Binding HardwareVersions}" SelectedItem="{Binding SelectedVersion}"  Width="300" SearchProperty="FullName" FontSize="16" FontWeight="Bold" Margin="5 0 0 0" materialDesign:HintAssist.Hint="Hardware Version">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock><Run Text="{Binding Name}"></Run> <Run></Run> <Run Foreground="{StaticResource MainWindow.Foreground}" FontSize="14">v</Run><Run Foreground="{StaticResource MainWindow.Foreground}" FontSize="14" Text="{Binding Version}"></Run></TextBlock>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>
                                    </controls:SearchComboBox>

                                </StackPanel>
                                <Button Margin="100 10 0 0" Cursor="Hand" Height="40" FontSize="12" ToolTip="Open Comparison Wizard" Command="{Binding OpenComparisonWizardCommand}">
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Width="24" Height="24" Kind="Compare"/>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="16">Comparison Wizard</TextBlock>
                                    </StackPanel>
                                </Button>

                                <Button  Margin="10 10 0 0" Cursor="Hand" MinWidth="150" Height="40" FontSize="12" ToolTip="Import hardware version to file" Command="{Binding ImportHardwareVersionCommand}">
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Width="24" Height="24" Kind="FileImport"/>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="16">IMPORT</TextBlock>
                                    </StackPanel>
                                </Button>

                                <Button  Margin="10 10 0 0" Cursor="Hand" MinWidth="150" Height="40" FontSize="12" ToolTip="Export hardware version to file" Command="{Binding ExportHardwareVersionCommand}">
                                    <StackPanel Orientation="Horizontal">
                                        <materialDesign:PackIcon Width="24" Height="24" Kind="FileExport"/>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="16">EXPORT</TextBlock>
                                    </StackPanel>
                                </Button>
                            </StackPanel>
                        </Grid>


                        <Grid Grid.Row="1">


                            <ScrollViewer VerticalScrollBarVisibility="Auto" Margin="50 20 0 0" IsEnabled="{Binding IsFree}">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <Image VerticalAlignment="Center" Source="../Images/engine.png" Width="32"></Image>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">MOTORS</TextBlock>
                                    </StackPanel>
                                    <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareMotors}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate DataType="{x:Type entities:HardwareMotor}">
                                                <DockPanel>
                                                    <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
                                                        <Button.Style>
                                                            <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
                                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareMotor}">
                                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Button.Style>
                                                        <Button.Content>
                                                            <StackPanel Orientation="Horizontal">
                                                                <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock>
                                                                <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" />
                                                            </StackPanel>
                                                        </Button.Content>
                                                    </Button>
                                                    <StackPanel Orientation="Horizontal">
                                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
                                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareMotorType.Description}"></TextBlock>
                                                    </StackPanel>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>

                                    <StackPanel Orientation="Horizontal" Margin="0 20 0 0">
                                        <Image VerticalAlignment="Center" Source="../Images/compass.png" Width="32"></Image>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">DANCERS</TextBlock>
                                    </StackPanel>
                                    <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareDancers}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate DataType="{x:Type entities:HardwareDancer}">
                                                <DockPanel>
                                                    <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
                                                        <Button.Style>
                                                            <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
                                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareDancer}">
                                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Button.Style>
                                                        <Button.Content>
                                                            <StackPanel Orientation="Horizontal">
                                                                <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock>
                                                                <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" />
                                                            </StackPanel>
                                                        </Button.Content>
                                                    </Button>
                                                    <StackPanel Orientation="Horizontal">
                                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
                                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareDancerType.Description}"></TextBlock>
                                                    </StackPanel>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>

                                    <StackPanel Orientation="Horizontal" Margin="0 20 0 0">
                                        <Image VerticalAlignment="Center" Source="../Images/balance.png" Width="32"></Image>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">PID CONTROLS</TextBlock>
                                    </StackPanel>
                                    <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwarePidControls}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate DataType="{x:Type entities:HardwarePidControl}">
                                                <DockPanel>
                                                    <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
                                                        <Button.Style>
                                                            <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
                                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwarePidControl}">
                                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Button.Style>
                                                        <Button.Content>
                                                            <StackPanel Orientation="Horizontal">
                                                                <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock>
                                                                <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" />
                                                            </StackPanel>
                                                        </Button.Content>
                                                    </Button>
                                                    <StackPanel Orientation="Horizontal">
                                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
                                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwarePidControlType.Description}"></TextBlock>
                                                    </StackPanel>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>

                                    <StackPanel Orientation="Horizontal" Margin="0 20 0 0">
                                        <Image VerticalAlignment="Center" Source="../Images/thread.png" Width="32"></Image>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">WINDERS</TextBlock>
                                    </StackPanel>
                                    <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareWinders}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate DataType="{x:Type entities:HardwareWinder}">
                                                <DockPanel>
                                                    <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
                                                        <Button.Style>
                                                            <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
                                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareWinder}">
                                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Button.Style>
                                                        <Button.Content>
                                                            <StackPanel Orientation="Horizontal">
                                                                <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock>
                                                                <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" />
                                                            </StackPanel>
                                                        </Button.Content>
                                                    </Button>
                                                    <StackPanel Orientation="Horizontal">
                                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
                                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareWinderType.Description}"></TextBlock>
                                                    </StackPanel>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>

                                    <StackPanel Orientation="Horizontal" Margin="0 20 0 0">
                                        <Image VerticalAlignment="Center" Source="../Images/speed.png" Width="32"></Image>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">SPEED SENSORS</TextBlock>
                                    </StackPanel>
                                    <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareSpeedSensors}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate DataType="{x:Type entities:HardwareSpeedSensor}">
                                                <DockPanel>
                                                    <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
                                                        <Button.Style>
                                                            <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
                                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareSpeedSensor}">
                                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Button.Style>
                                                        <Button.Content>
                                                            <StackPanel Orientation="Horizontal">
                                                                <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock>
                                                                <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" />
                                                            </StackPanel>
                                                        </Button.Content>
                                                    </Button>
                                                    <StackPanel Orientation="Horizontal">
                                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
                                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareSpeedSensorType.Description}"></TextBlock>
                                                    </StackPanel>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>

                                    <StackPanel Orientation="Horizontal" Margin="0 20 0 0">
                                        <Image VerticalAlignment="Center" Source="../Images/blower.png" Width="32"></Image>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">BLOWERS</TextBlock>
                                    </StackPanel>
                                    <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareBlowers}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate DataType="{x:Type entities:HardwareBlower}">
                                                <DockPanel>
                                                    <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
                                                        <Button.Style>
                                                            <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
                                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareBlower}">
                                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Button.Style>
                                                        <Button.Content>
                                                            <StackPanel Orientation="Horizontal">
                                                                <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock>
                                                                <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" />
                                                            </StackPanel>
                                                        </Button.Content>
                                                    </Button>
                                                    <StackPanel Orientation="Horizontal">
                                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
                                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareBlowerType.Description}"></TextBlock>
                                                    </StackPanel>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>

                                    <StackPanel Orientation="Horizontal" Margin="0 20 0 0">
                                        <Image VerticalAlignment="Center" Source="../Images/break.png" Width="32"></Image>
                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold">BREAK SENSORS</TextBlock>
                                    </StackPanel>
                                    <ListBox Style="{StaticResource typesList}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding CurrentVersion.HardwareBreakSensors}" Margin="60 15" SelectedItem="{Binding SelectedHardwareObject}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate DataType="{x:Type entities:HardwareBreakSensor}">
                                                <DockPanel>
                                                    <Button DockPanel.Dock="Right" Cursor="Hand" Foreground="DimGray" Height="20" FontSize="10" ToolTip="Copy this item parameters to the selected item" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyParametersCommand}" CommandParameter="{Binding}">
                                                        <Button.Style>
                                                            <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
                                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedHardwareObject.ObjectType.BaseType}" Value="{x:Type entities:HardwareBreakSensor}">
                                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                                    </DataTrigger>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                                    </DataTrigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Button.Style>
                                                        <Button.Content>
                                                            <StackPanel Orientation="Horizontal">
                                                                <TextBlock VerticalAlignment="Center">Copy Parameters</TextBlock>
                                                                <materialDesign:PackIcon Margin="10 0 0 0" VerticalAlignment="Center" Kind="ArrowRight" Width="16" Height="16" />
                                                            </StackPanel>
                                                        </Button.Content>
                                                    </Button>
                                                    <StackPanel Orientation="Horizontal">
                                                        <CheckBox VerticalAlignment="Center" IsChecked="{Binding Active}"></CheckBox>
                                                        <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding HardwareBreakSensorType.Description}"></TextBlock>
                                                    </StackPanel>
                                                </DockPanel>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>
                                </StackPanel>
                            </ScrollViewer>

                        </Grid>

                    </Grid>
                </Grid>

                <Grid Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition Height="60"/>
                    </Grid.RowDefinitions>

                    <ScrollViewer IsEnabled="{Binding IsFree}" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Margin="0 90 0 10">
                        <Grid>
                            <StackPanel>
                                <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource WhiteBackgroundBrush}" Padding="20 10">
                                    <StackPanel >
                                        <TextBlock Text="HARDWARE VERSION" Foreground="{StaticResource GrayBrush}" FontWeight="Bold" FontStyle="Italic" FontSize="16"></TextBlock>

                                        <TextBlock Margin="0 10 0 0" FontSize="10" Foreground="{StaticResource GrayBrush}">Name</TextBlock>
                                        <TextBox Text="{Binding CurrentVersion.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox>

                                        <TextBlock Margin="0 20 0 0" FontSize="10" Foreground="{StaticResource GrayBrush}">Version</TextBlock>
                                        <mahApps:NumericUpDown Minimum="0" BorderThickness="0 0 0 1" HorizontalContentAlignment="Left" Maximum="1000" HasDecimals="True" Value="{Binding CurrentVersion.Version}" Foreground="{StaticResource GrayBrush}"/>
                                    </StackPanel>
                                </materialDesign:Card>

                                <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource WhiteBackgroundBrush}">
                                    <StackPanel >
                                        <Grid>
                                            <Expander HorizontalAlignment="Stretch" IsExpanded="True" Background="{DynamicResource Card.Background}">
                                                <Expander.Header>
                                                    <TextBlock FontSize="18" Foreground="{StaticResource MainWindow.Foreground}" FontWeight="Bold" FontStyle="Italic">
                                                        <Run Text="{Binding SelectedHardwareObjectTypeName,Mode=OneWay}"></Run>
                                                    </TextBlock>
                                                </Expander.Header>
                                                <StackPanel >
                                                    <editors:ParameterizedEditor ParameterizedObject="{Binding SelectedHardwareObject}" Padding="10">
                                                        <editors:ParameterizedEditor.ItemsPanel>
                                                            <ItemsPanelTemplate>
                                                                <StackPanel></StackPanel>
                                                            </ItemsPanelTemplate>
                                                        </editors:ParameterizedEditor.ItemsPanel>
                                                        <editors:ParameterizedEditor.DoubleTemplate>
                                                            <DataTemplate>
                                                                <DockPanel>
                                                                    <mahApps:NumericUpDown  DockPanel.Dock="Right" Background="Transparent" BorderThickness="0 0 0 0" Value="{Binding Value,UpdateSourceTrigger=PropertyChanged}" HasDecimals="True" HorizontalContentAlignment="Center" Width="100" />
                                                                    <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock>
                                                                </DockPanel>
                                                            </DataTemplate>
                                                        </editors:ParameterizedEditor.DoubleTemplate>
                                                        <editors:ParameterizedEditor.Int32Template>
                                                            <DataTemplate>
                                                                <DockPanel>
                                                                    <mahApps:NumericUpDown  DockPanel.Dock="Right" Background="Transparent" BorderThickness="0 0 0 0" Value="{Binding Value,Converter={StaticResource DoubleToIntConverter},UpdateSourceTrigger=PropertyChanged}" HasDecimals="False" HorizontalContentAlignment="Center" Width="100" />
                                                                    <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock>
                                                                </DockPanel>
                                                            </DataTemplate>
                                                        </editors:ParameterizedEditor.Int32Template>
                                                        <editors:ParameterizedEditor.BooleanTemplate>
                                                            <DataTemplate>
                                                                <DockPanel Margin="0 5 0 0">
                                                                    <ToggleButton DockPanel.Dock="Right"  Width="100" IsChecked="{Binding Value}" HorizontalAlignment="Right"  Foreground="{StaticResource MainWindow.Foreground}"/>
                                                                    <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock>
                                                                </DockPanel>
                                                            </DataTemplate>
                                                        </editors:ParameterizedEditor.BooleanTemplate>
                                                    </editors:ParameterizedEditor>
                                                </StackPanel>
                                            </Expander>
                                        </Grid>
                                    </StackPanel>
                                </materialDesign:Card>
                            </StackPanel>
                        </Grid>
                    </ScrollViewer>

                    <Grid Grid.Row="1" Margin="10 0 10 10">
                        <UniformGrid Rows="1">
                            <Button Height="Auto" Grid.Column="1" Command="{Binding DeleteCommand}" Margin="2" Background="{StaticResource RedBrush400}" BorderBrush="{StaticResource RedBrush400}">
                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon Width="20" Height="20" VerticalAlignment="Center" Kind="Delete"></materialDesign:PackIcon>
                                    <TextBlock FontSize="14" Margin="10 0 0 0" VerticalAlignment="Center">DEL</TextBlock>
                                </StackPanel>
                            </Button>
                            <Button Height="Auto" Grid.Column="1" Command="{Binding NewCommand}" Margin="2" Background="#6BD16F" BorderBrush="#6BD16F">
                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon Width="20" Height="20" VerticalAlignment="Center" Kind="Plus"></materialDesign:PackIcon>
                                    <TextBlock FontSize="14" Margin="10 0 0 0" VerticalAlignment="Center">NEW</TextBlock>
                                </StackPanel>
                            </Button>
                            <Button Height="Auto" Grid.Column="1" Command="{Binding CloneCommand}" Margin="2" Background="{StaticResource OrangeBrush300}" BorderBrush="{StaticResource OrangeBrush300}">
                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon Width="20" Height="20" VerticalAlignment="Center" Kind="ContentCopy"></materialDesign:PackIcon>
                                    <TextBlock FontSize="14" Margin="10 0 0 0" VerticalAlignment="Center">CLONE</TextBlock>
                                </StackPanel>
                            </Button>
                            <Button Height="Auto" Command="{Binding SaveCommand}" Margin="2">
                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon Width="20" Height="20" VerticalAlignment="Center" Kind="ContentSaveSettings"></materialDesign:PackIcon>
                                    <TextBlock FontSize="14" Margin="10 0 0 0" VerticalAlignment="Center">SAVE</TextBlock>
                                </StackPanel>
                            </Button>
                        </UniformGrid>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>

        <dragAndDrop:DraggingSurface x:Name="dragSufrace" />
    </Grid>
</UserControl>