aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml
blob: 9bb995bd88eba7f07c5e26801312d6a6b0f5c076 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<UserControl x:Class="Tango.MachineStudio.Synchronization.Views.RemoteSynchronizationView"
             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:providers="clr-namespace:Tango.MachineStudio.Synchronization.AutoComplete"
             xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:synchronization="clr-namespace:Tango.Synchronization;assembly=Tango.Synchronization"
             xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete"
             xmlns:global="clr-namespace:Tango.MachineStudio.Synchronization"
             
             xmlns:local="clr-namespace:Tango.MachineStudio.Synchronization.Views"
             xmlns:fa="http://schemas.fontawesome.io/icons/"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.RemoteSynchronizationViewVM}">
    <UserControl.Resources>

        <providers:MachinesProvider x:Key="MachinesProvider"></providers:MachinesProvider>
        
        <VisualBrush x:Key="badgeBackground">
            <VisualBrush.Visual>
                <Border>
                    <Path Stretch="Fill" RenderTransformOrigin="0.5,0.5">
                        <Path.RenderTransform>
                            <ScaleTransform ScaleX="-1"></ScaleTransform>
                        </Path.RenderTransform>
                        <Path.Fill>
                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                <GradientStop Color="#EEEEEE" Offset="0.4" />
                                <GradientStop Color="White" Offset="1"/>
                            </LinearGradientBrush>
                        </Path.Fill>
                        <Path.Data>
                            <PathGeometry Figures="M 53.868 43.913 H 19.511 c -0.444 0 -0.875 -0.151 -1.221 -0.428 L 0.734 29.439 c -0.978 -0.783 -0.978 -2.271 0 -3.053 L 18.29 12.341 c 0.347 -0.277 0.777 -0.428 1.221 -0.428 h 34.356 c 1.081 0 1.958 0.877 1.958 1.958 v 28.084 c 0 1.081 -0.876 1.958 -1.957 1.958 z" FillRule="NonZero"/>
                        </Path.Data>
                    </Path>
                </Border>
            </VisualBrush.Visual>
        </VisualBrush>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid>
            <StackPanel Orientation="Horizontal" Margin="20">
                <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Margin="0 5 0 0" VerticalAlignment="Center" Command="{Binding BackCommand}">
                    <materialDesign:PackIcon Kind="ArrowLeft" Foreground="#303030" ToolTip="Back" VerticalAlignment="Center" Width="40" Height="40"></materialDesign:PackIcon>
                </Button>
                <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="30">Local Database Synchronization</TextBlock>
            </StackPanel>
        </Grid>
        <Grid Grid.Row="1">
            <Grid Margin="20">
                <GroupBox Header="Compare &amp; Synchronize">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="57*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MaxWidth="250" />
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>

                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>

                            <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0 0 0">
                                <Image Source="../Images/remote-db.png"  Width="100" Margin="10" Opacity="0.8" HorizontalAlignment="Left" RenderOptions.BitmapScalingMode="Fant"></Image>
                                <TextBlock Background="{StaticResource badgeBackground}" Padding="5" Width="200" FontSize="14" HorizontalAlignment="Left">Remote Database</TextBlock>
                                <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                                    <fa:ImageAwesome Icon="Key" Width="16" Height="16"></fa:ImageAwesome>
                                    <autoComplete:AutoCompleteTextBox Margin="5 0 0 0" Width="170" materialDesign:HintAssist.Hint="Enter machine serial number" DisplayMember="SerialNumber" Provider="{StaticResource ResourceKey=MachinesProvider}" SelectedItem="{Binding SelectedMachine,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                                        <autoComplete:AutoCompleteTextBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding SerialNumber}"></TextBlock>
                                            </DataTemplate>
                                        </autoComplete:AutoCompleteTextBox.ItemTemplate>
                                        <autoComplete:AutoCompleteTextBox.LoadingContent>
                                            <TextBlock Text="Loading..." Margin="5" FontSize="14" />
                                        </autoComplete:AutoCompleteTextBox.LoadingContent>
                                    </autoComplete:AutoCompleteTextBox>
                                </StackPanel>
                            </StackPanel>

                            <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="1" Margin="20 0 0 0">
                                <Image Source="../Images/sqlite.png"  Width="80" Margin="10" Opacity="0.8" HorizontalAlignment="Left" RenderOptions.BitmapScalingMode="Fant"></Image>
                                <TextBlock Background="{StaticResource badgeBackground}" Padding="5" Width="200" FontSize="14" HorizontalAlignment="Left">SQLite Database</TextBlock>
                                <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                                    <TextBox IsReadOnly="True" Width="130" BorderBrush="#4E4E4E" Text="{Binding SlaveDBName}" ToolTip="{Binding SlaveDBFile}"></TextBox>
                                    <Button Margin="5 0 0 0" Cursor="Hand" VerticalAlignment="Center" Style="{DynamicResource MetroCircleButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding BrowseSlaveDBCommand}" ToolTip="Browse for slave database file">
                                        <fa:ImageAwesome Icon="FolderOpen" Width="24" Foreground="Gray"></fa:ImageAwesome>
                                    </Button>
                                </StackPanel>
                            </StackPanel>
                        </Grid>

                        <Button Margin="20 10" Grid.Row="1" Width="160" Height="40" HorizontalAlignment="Left" Command="{Binding CompareCommand}">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">COMPARE</TextBlock>
                                <fa:ImageAwesome Icon="LongArrowRight" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome>
                            </StackPanel>
                        </Button>

                        <Grid Grid.Column="1">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="20"/>
                                <RowDefinition Height="205*"/>
                            </Grid.RowDefinitions>
                            <TextBlock Margin="10 5 0 0" FontSize="14">Differences</TextBlock>
                            <ListBox Margin="10" Background="#F1F1F1" Grid.Row="1" ItemsSource="{Binding Differences}" SelectedItem="{Binding SelectedDifference,Mode=TwoWay}">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <Border Padding="10">
                                            <StackPanel Orientation="Horizontal">
                                                <fa:ImageAwesome Icon="Cog" Width="20" Height="20" Foreground="Gray"></fa:ImageAwesome>
                                                <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Text="{Binding Description}">
                                                    <TextBlock.Style>
                                                        <Style TargetType="TextBlock">
                                                            <Setter Property="Foreground" Value="Red"></Setter>
                                                            <Style.Triggers>
                                                                <DataTrigger Binding="{Binding Action}" Value="ReplaceTableDataInSlave">
                                                                    <Setter Property="Foreground" Value="#404040"></Setter>
                                                                </DataTrigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </TextBlock.Style>
                                                </TextBlock>
                                            </StackPanel>
                                        </Border>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </Grid>

                        <Grid Grid.Row="1" Grid.Column="1">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                <Button Margin="10 10" Grid.Row="1" Width="240" Height="40" Background="#FF4F4F" BorderBrush="#FF4F4F" HorizontalAlignment="Right" Command="{Binding CleanCommand}">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">CLEAN SQLITE DATABASE</TextBlock>
                                        <fa:ImageAwesome Icon="TrashOutline" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome>
                                    </StackPanel>
                                </Button>
                                <Button Margin="10 10" Grid.Row="1" Width="160" Height="40" HorizontalAlignment="Right" Command="{Binding CommitCommand}">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">COMMIT</TextBlock>
                                        <fa:ImageAwesome Icon="Bolt" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome>
                                    </StackPanel>
                                </Button>
                                <Button Margin="10 10" Grid.Row="1" Width="160" Height="40" HorizontalAlignment="Right" Command="{Binding CommitAllCommand}">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">COMMIT ALL</TextBlock>
                                        <fa:ImageAwesome Icon="SortAmountAsc" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome>
                                    </StackPanel>
                                </Button>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </GroupBox>
            </Grid>

          
        </Grid>
    </Grid>
</UserControl>
<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>