aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml
blob: 55b3580fe2be2b9470339801e617e9951229cbac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Tango.Scripting.Editors
{
    internal static class ExtensionMethodsNoName
    {
        public static String Remove(this String str, String pattern)
        {
            return Regex.Replace(str, pattern, "");
        }

        public static String GetFriendlyName(this Type type)
        {
            String name = type.Name;

            if (type.IsGenericType)
            {
                List<String> args = new List<string>();

                foreach (var lGenericArgument in type.GetGenericArguments())
                {
                    args.Add(lGenericArgument.Name);
                }

                String gArgs = String.Join(",", args);

                name = $"{new String(type.Name.TakeWhile(x => x != '`').ToArray())}<{gArgs}>";
            }

            return name;
        }
    }
}
5' href='#n355'>355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 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
<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: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="720" Background="Transparent" 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" />
    </UserControl.Resources>

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

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200"/>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>

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

                        <Grid Margin="-210 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" />
                                    <ComboBox ItemsSource="{Binding Adapter.HardwareVersions}" SelectedItem="{Binding SelectedVersion}" Width="300" 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="Gray" FontSize="14">v</Run><Run Foreground="Gray" FontSize="14" Text="{Binding Version}"></Run></TextBlock>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>
                                    </ComboBox>
                                </StackPanel>
                            </StackPanel>
                        </Grid>

                        <Viewbox MaxWidth="1200" Grid.Row="1" >
                            <Grid VerticalAlignment="Top">

                                <Image IsHitTestVisible="False" Source="../Images/machine-sketch-trans.png" MaxWidth="800" RenderOptions.BitmapScalingMode="Fant">
                                    <Image.Effect>
                                        <DropShadowEffect ShadowDepth="0" BlurRadius="20" Opacity="1" RenderingBias="Performance" Color="DimGray"></DropShadowEffect>
                                    </Image.Effect>
                                </Image>

                                <Canvas ClipToBounds="False" x:Name="canvas">
                                    <Border BorderThickness="1" BorderBrush="Gray" CornerRadius="0 0 20 20" Width="707" Height="132" Canvas.Left="50" Canvas.Top="378" Background="#ABFFFFFF">
                                        <Grid Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnDancerDrop">
                                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Silver" FontSize="20">DRAG &amp; DROP DANCERS</TextBlock>
                                            <ListBox x:Name="listDancers" ItemContainerStyle="{StaticResource basicListBoxItem}" HorizontalAlignment="Center" VerticalAlignment="Center" ItemsSource="{Binding CurrentVersion.HardwareDancers}" SelectedItem="{Binding SelectedHardwareObject,Mode=TwoWay}" Margin="0 5 0 0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                                                <ListBox.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <WrapPanel Orientation="Horizontal" />
                                                    </ItemsPanelTemplate>
                                                </ListBox.ItemsPanel>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate DataType="{x:Type observables:HardwareDancer}">
                                                        <Grid Style="{StaticResource draggableGrid}">
                                                            <Border Margin="5" CornerRadius="5" Width="100" Height="100" BorderThickness="1" Padding="2" IsHitTestVisible="False">
                                                                <Border.Style>
                                                                    <Style TargetType="Border">
                                                                        <Setter Property="BorderBrush" Value="Silver"></Setter>
                                                                        <Style.Triggers>
                                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                                <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter>
                                                                            </DataTrigger>
                                                                        </Style.Triggers>
                                                                    </Style>
                                                                </Border.Style>
                                                                <Border.Background>
                                                                    <LinearGradientBrush>
                                                                        <GradientStop Color="White"/>
                                                                        <GradientStop Color="#FFD6D6D6" Offset="1"/>
                                                                    </LinearGradientBrush>
                                                                </Border.Background>
                                                                <Grid>
                                                                    <StackPanel>
                                                                        <Image Source="../Images/compass.png" Width="32" Margin="5" />
                                                                        <TextBlock FontSize="8" TextAlignment="Center" TextWrapping="Wrap" Margin="0 5 0 0" Text="{Binding HardwareDancerType.Name}" VerticalAlignment="Center"></TextBlock>
                                                                    </StackPanel>
                                                                </Grid>
                                                            </Border>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                        </Grid>
                                    </Border>

                                    <Border BorderThickness="1 1 1 0" BorderBrush="Gray" Width="576" Height="157" Canvas.Left="114" Canvas.Top="224" Background="#ABFFFFFF">
                                        <Grid Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnMotorsDrop">
                                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Silver" FontSize="20">DRAG &amp; DROP MOTORS</TextBlock>
                                            <ListBox x:Name="listMotors" ItemContainerStyle="{StaticResource basicListBoxItem}" HorizontalAlignment="Center" VerticalAlignment="Center" ItemsSource="{Binding CurrentVersion.HardwareMotors}" SelectedItem="{Binding SelectedHardwareObject,Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                                                <ListBox.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <WrapPanel Orientation="Horizontal" />
                                                    </ItemsPanelTemplate>
                                                </ListBox.ItemsPanel>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate DataType="{x:Type observables:HardwareMotor}">
                                                        <Grid Style="{StaticResource draggableGrid}">
                                                            <Border Margin="4" CornerRadius="3" Height="25" IsHitTestVisible="False" MaxWidth="100" BorderThickness="1" Padding="5 2 9 2">
                                                                <Border.Style>
                                                                    <Style TargetType="Border">
                                                                        <Setter Property="BorderBrush" Value="Silver"></Setter>
                                                                        <Style.Triggers>
                                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                                <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter>
                                                                            </DataTrigger>
                                                                        </Style.Triggers>
                                                                    </Style>
                                                                </Border.Style>
                                                                <Border.Background>
                                                                    <LinearGradientBrush>
                                                                        <GradientStop Color="White"/>
                                                                        <GradientStop Color="#FFD6D6D6" Offset="1"/>
                                                                    </LinearGradientBrush>
                                                                </Border.Background>
                                                                <Grid>
                                                                    <StackPanel Orientation="Horizontal">
                                                                        <Image Source="../Images/engine.png" Width="16" />
                                                                        <TextBlock FontSize="8" Margin="5 0 0 0" TextTrimming="CharacterEllipsis" Text="{Binding HardwareMotorType.Description}" VerticalAlignment="Center"></TextBlock>
                                                                    </StackPanel>
                                                                </Grid>
                                                            </Border>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                        </Grid>
                                    </Border>

                                    <Border BorderThickness="1 1 1 0" BorderBrush="Gray" Width="545" Height="120" Canvas.Left="130" Canvas.Top="105" Background="#ABFFFFFF" CornerRadius="20 20 0 0" Padding="5">
                                        <Grid Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnPidControlDrop">
                                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Silver" FontSize="20">DRAG &amp; DROP PID CONTROLS</TextBlock>
                                            <ListBox x:Name="listPid" ItemContainerStyle="{StaticResource basicListBoxItem}" HorizontalAlignment="Center" VerticalAlignment="Center" ItemsSource="{Binding CurrentVersion.HardwarePidControls}" SelectedItem="{Binding SelectedHardwareObject,Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                                                <ListBox.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <WrapPanel Orientation="Horizontal" />
                                                    </ItemsPanelTemplate>
                                                </ListBox.ItemsPanel>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate DataType="{x:Type observables:HardwarePidControl}">
                                                        <Grid Style="{StaticResource draggableGrid}">
                                                            <Border Margin="4" CornerRadius="3" Height="25" IsHitTestVisible="False" MaxWidth="100" BorderThickness="1" Padding="5 2 9 2">
                                                                <Border.Style>
                                                                    <Style TargetType="Border">
                                                                        <Setter Property="BorderBrush" Value="Silver"></Setter>
                                                                        <Style.Triggers>
                                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                                <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter>
                                                                            </DataTrigger>
                                                                        </Style.Triggers>
                                                                    </Style>
                                                                </Border.Style>
                                                                <Border.Background>
                                                                    <LinearGradientBrush>
                                                                        <GradientStop Color="White"/>
                                                                        <GradientStop Color="#FFD6D6D6" Offset="1"/>
                                                                    </LinearGradientBrush>
                                                                </Border.Background>
                                                                <Grid>
                                                                    <StackPanel Orientation="Horizontal">
                                                                        <Image Source="../Images/balance.png" Width="16" />
                                                                        <TextBlock FontSize="8" Margin="5 0 0 0" TextTrimming="CharacterEllipsis" Text="{Binding HardwarePidControlType.Description}" VerticalAlignment="Center"></TextBlock>
                                                                    </StackPanel>
                                                                </Grid>
                                                            </Border>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                        </Grid>
                                    </Border>

                                    <Border BorderThickness="1 1 1 0" BorderBrush="Gray" Width="296" Height="73" Canvas.Left="255" Canvas.Top="33" Background="#ABFFFFFF" CornerRadius="20 20 0 0" Padding="5">
                                        <Grid Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnDropWinder">
                                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Silver" FontSize="16">DRAG &amp; DROP WINDERS</TextBlock>
                                            <ListBox x:Name="listWinders" ItemContainerStyle="{StaticResource basicListBoxItem}" HorizontalAlignment="Center" VerticalAlignment="Center" ItemsSource="{Binding CurrentVersion.HardwareWinders}" SelectedItem="{Binding SelectedHardwareObject,Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                                                <ListBox.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <WrapPanel Orientation="Horizontal" />
                                                    </ItemsPanelTemplate>
                                                </ListBox.ItemsPanel>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate DataType="{x:Type observables:HardwareMotor}">
                                                        <Grid Style="{StaticResource draggableGrid}">
                                                            <Border Margin="4" CornerRadius="3" Height="53" IsHitTestVisible="False" MaxWidth="100" BorderThickness="1" Padding="5 2 9 2">
                                                                <Border.Style>
                                                                    <Style TargetType="Border">
                                                                        <Setter Property="BorderBrush" Value="Silver"></Setter>
                                                                        <Style.Triggers>
                                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
                                                                                <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter>
                                                                            </DataTrigger>
                                                                        </Style.Triggers>
                                                                    </Style>
                                                                </Border.Style>
                                                                <Border.Background>
                                                                    <LinearGradientBrush>
                                                                        <GradientStop Color="White"/>
                                                                        <GradientStop Color="#FFD6D6D6" Offset="1"/>
                                                                    </LinearGradientBrush>
                                                                </Border.Background>
                                                                <Grid>
                                                                    <StackPanel Orientation="Horizontal">
                                                                        <Image Source="../Images/thread.png" Width="16" />
                                                                        <TextBlock FontSize="8" Margin="5 0 0 0" TextTrimming="CharacterEllipsis" Text="{Binding HardwareWinderType.Description}" VerticalAlignment="Center"></TextBlock>
                                                                    </StackPanel>
                                                                </Grid>
                                                            </Border>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                        </Grid>
                                    </Border>
                                </Canvas>
                            </Grid>
                        </Viewbox>
                    </Grid>

                    <Grid>
                        <Grid VerticalAlignment="Bottom" Margin="0 0 0 50" Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnTrashDrop">
                            <StackPanel Margin="0 0 -80 50">
                                <TextBlock HorizontalAlignment="Center" FontSize="20" Foreground="Gray">
                                    DROP HERE TO DELETE
                                </TextBlock>
                                <materialDesign:PackIcon Kind="ArrowDown" HorizontalAlignment="Center" Width="32" Height="32" Foreground="Gray" Margin="0 10 0 0" />
                                <materialDesign:PackIcon Kind="Delete" Foreground="#9EFF6A6A" Width="250" Height="250" HorizontalAlignment="Center" />
                            </StackPanel>
                        </Grid>
                    </Grid>
                </Grid>

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

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

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

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

                                <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource MaterialDesignBackground}">
                                    <StackPanel>
                                        <Expander HorizontalAlignment="Stretch" Header="Winders">
                                            <ListBox ItemsSource="{Binding Adapter.HardwareWinderTypes}" HorizontalContentAlignment="Stretch">
                                                <ListBox.ItemContainerStyle>
                                                    <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
                                                        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                                                        <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
                                                        <Setter Property="Padding" Value="1"></Setter>
                                                    </Style>
                                                </ListBox.ItemContainerStyle>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}">
                                                            <StackPanel Orientation="Horizontal" Margin="2 8">
                                                                <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/thread.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image>
                                                                <StackPanel Margin="5 0 0 0" IsHitTestVisible="False" VerticalAlignment="Center">
                                                                    <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Description}"></Run></TextBlock>
                                                                </StackPanel>
                                                            </StackPanel>

                                                            <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                        </Expander>
                                        <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" />
                                        <Expander HorizontalAlignment="Stretch" Header="PID Controls">
                                            <ListBox ItemsSource="{Binding Adapter.HardwarePidControlTypes}" HorizontalContentAlignment="Stretch">
                                                <ListBox.ItemContainerStyle>
                                                    <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
                                                        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                                                        <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
                                                        <Setter Property="Padding" Value="1"></Setter>
                                                    </Style>
                                                </ListBox.ItemContainerStyle>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}">
                                                            <StackPanel Orientation="Horizontal" Margin="2 8">
                                                                <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/balance.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image>
                                                                <StackPanel Margin="5 0 0 0" IsHitTestVisible="False" VerticalAlignment="Center">
                                                                    <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Description}"></Run></TextBlock>
                                                                </StackPanel>
                                                            </StackPanel>

                                                            <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                        </Expander>
                                        <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" />
                                        <Expander HorizontalAlignment="Stretch" Header="Motors">
                                            <ListBox ItemsSource="{Binding Adapter.HardwareMotorTypes}" HorizontalContentAlignment="Stretch">
                                                <ListBox.ItemContainerStyle>
                                                    <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
                                                        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                                                        <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
                                                        <Setter Property="Padding" Value="1"></Setter>
                                                    </Style>
                                                </ListBox.ItemContainerStyle>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}">
                                                            <StackPanel Orientation="Horizontal" Margin="2 8">
                                                                <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/engine.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image>
                                                                <StackPanel Margin="5 0 0 0" IsHitTestVisible="False" VerticalAlignment="Center">
                                                                    <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Description}"></Run></TextBlock>
                                                                </StackPanel>
                                                            </StackPanel>

                                                            <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                        </Expander>
                                        <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" />
                                        <Expander HorizontalAlignment="Stretch" Header="Dancers">
                                            <ListBox ItemsSource="{Binding Adapter.HardwareDancerTypes}" HorizontalContentAlignment="Stretch">
                                                <ListBox.ItemContainerStyle>
                                                    <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
                                                        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                                                        <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
                                                        <Setter Property="Padding" Value="1"></Setter>
                                                    </Style>
                                                </ListBox.ItemContainerStyle>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}">
                                                            <StackPanel Orientation="Horizontal" Margin="2 8">
                                                                <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/compass.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image>
                                                                <StackPanel Margin="5 0 0 0" IsHitTestVisible="False" VerticalAlignment="Center">
                                                                    <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Description}"></Run></TextBlock>
                                                                </StackPanel>
                                                            </StackPanel>

                                                            <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle>
                                                        </Grid>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                        </Expander>
                                    </StackPanel>
                                </materialDesign:Card>

                                <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource MaterialDesignBackground}">
                                    <StackPanel>
                                        <Grid>
                                            <Expander HorizontalAlignment="Stretch" Header="Component Properties" IsExpanded="True">
                                                <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"></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"></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" />
                                                                <TextBlock Text="{Binding Name}" VerticalAlignment="Center"></TextBlock>
                                                            </DockPanel>
                                                        </DataTemplate>
                                                    </editors:ParameterizedEditor.BooleanTemplate>
                                                </editors:ParameterizedEditor>
                                            </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="#FF8A8A" BorderBrush="#FF8A8A">
                                <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" 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>