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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
<local:ElementEditor x:Class="Tango.MachineStudio.Technician.Editors.DispenserElementEditor"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems"
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors"
xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:visuals="clr-namespace:Tango.Visuals;assembly=Tango.Visuals"
xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors"
mc:Ignorable="d" Background="Transparent" ClipToBounds="False" BorderThickness="0" MinWidth="1" MinHeight="1" RenderTransformOrigin="0.5,0.5" d:DataContext="{d:DesignInstance Type=items:DispenserItem, IsDesignTimeCreatable=False}" Height="183.393" Width="174.65">
<UserControl.Resources>
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter>
<sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" />
<!--Theme-->
<SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush>
<SolidColorBrush x:Key="CornersBrush" Color="Red"></SolidColorBrush>
<Grid x:Key="gridHoming">
<DockPanel>
<Button Click="OnHomingStopped" DockPanel.Dock="Right" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" VerticalAlignment="Center" Margin="0 0 5 0" ToolTip="Stop Homing">
<materialDesign:PackIcon Kind="Stop" Foreground="{StaticResource RedBrush100}" HorizontalAlignment="Center" VerticalAlignment="Center" Width="32" Height="32" />
</Button>
<ProgressBar Foreground="DimGray" BorderBrush="DimGray" Maximum="{Binding HomingMaximumProgress}" Value="{Binding HomingProgress}" VerticalAlignment="Center" Height="10" Margin="5 0 5 0" Background="Transparent"></ProgressBar>
</DockPanel>
</Grid>
<Grid x:Key="gridDefault">
<Viewbox Stretch="Fill">
<materialDesign:PackIcon Kind="Home" Margin="25 0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="Gainsboro">
<materialDesign:PackIcon.LayoutTransform>
<RotateTransform Angle="90" />
</materialDesign:PackIcon.LayoutTransform>
</materialDesign:PackIcon>
</Viewbox>
<UniformGrid Columns="2">
<Button Click="OnHomingBackwardStarted" HorizontalAlignment="Left" Width="60" Background="Transparent" BorderThickness="0">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource emptyButton}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value="0.5"></Setter>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
<materialDesign:PackIcon Kind="ChevronDoubleLeft" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" Foreground="Gainsboro" />
</Button>
<Button Click="OnHomingForwardStarted" HorizontalAlignment="Right" Width="60" Background="Transparent" BorderThickness="0">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource emptyButton}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value="0.5"></Setter>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
<materialDesign:PackIcon Kind="ChevronDoubleRight" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" Foreground="Gainsboro" />
</Button>
</UniformGrid>
</Grid>
</UserControl.Resources>
<UserControl.RenderTransform>
<RotateTransform Angle="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=Angle}"></RotateTransform>
</UserControl.RenderTransform>
<Grid>
<Grid>
<Grid.LayoutTransform>
<RotateTransform Angle="-90" />
</Grid.LayoutTransform>
<Viewbox Stretch="Uniform">
<Grid Margin="5" Width="430" Height="450">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="90*"/>
<ColumnDefinition Width="20*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="190*" />
<RowDefinition Height="40*" />
</Grid.RowDefinitions>
<Grid Grid.Column="1">
<Border BorderThickness="1" BorderBrush="#414141" CornerRadius="10" Background="#252525">
<Grid>
<Grid.LayoutTransform>
<RotateTransform Angle="90" />
</Grid.LayoutTransform>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="63*"/>
<ColumnDefinition Width="88*"/>
</Grid.ColumnDefinitions>
<Image Source="../Images/dispenser-line.png" Grid.ColumnSpan="2" Stretch="Fill"></Image>
<Path RenderTransformOrigin="0.5,0.5" Margin="10 80 40 10" HorizontalAlignment="Left" VerticalAlignment="Bottom" StrokeThickness="1" Stroke="{StaticResource DarkGrayBrush}" Stretch="Uniform" Data="M728.4 312.2l-198.1-63.4c-0.5-5.9-1.6-11.6-3.4-17c8.4-2.8 17-5.9 25.7-9.2c78.8-29.7 124.3-63 135-98.8 c7.2-23.8-0.5-47.5-22.6-70.3c-17.5-18-56.2-44.9-57.8-46c-6.2-4.3-14.7-2.8-19.1 3.3L465.5 180.8c-3.2-0.4-6.4-0.6-9.6-0.6 c-2.2 0-4.5 0.1-6.7 0.3c-0.5-62.6-8.3-142.4-41.1-178.6c-12.7-14.1-28.3-21.2-46.1-21.2c0 0 0 0 0 0c-12.3 0-25.6 3.5-39.7 10.4 c-17.4 8.6-43.8 27.5-55.6 36.2c-3.5 2.6-5.7 4.2-6.1 4.5c-3.7 2.8-5.6 7.2-5.4 11.6c0.1 2.6 1 5.3 2.7 7.5l128.9 175.8 c-1.4 3.5-2.6 7.1-3.4 10.8c-42.1-13.7-94.9-27.4-138.4-27.4c-34.2 0-59.1 8.6-73.8 25.7c-13 15-17.7 35.8-14 61.7 c3.6 24.8 19.1 69.3 19.7 71.2c2 5.7 7.3 9.3 13 9.3c1.4 0 2.9-0.2 4.3-0.7L404 308.3c2.3 2.3 4.8 4.4 7.4 6.3 c-7.3 10-14.8 20.7-22.3 32c-46.3 70.4-63.5 124-51.1 159.3c8.2 23.5 28.3 38.2 59.6 43.6c16.2 2.8 41.8 3.4 60.4 3.4 c8.1 0 13.5-0.1 13.5-0.1c7.5-0.2 13.5-6.3 13.5-13.9L484 323.8c4.1-1.7 8.1-3.7 11.8-6.1c6.1 8.3 12.6 16.9 19.5 25.6 c52.2 65.4 97.5 98.6 134.8 98.6c17.6 0 42.4-7.5 61.3-43.3c11.7-22.2 25.4-67.3 25.9-69.2C739.5 322.2 735.5 314.5 728.4 312.2z M455.9 293c-21.1 0-38.3-17.1-38.3-38.3s17.1-38.3 38.3-38.3c21.1 0 38.3 17.1 38.3 38.3C494.2 275.9 477 293 455.9 293z">
<Path.Fill>
<LinearGradientBrush>
<GradientStop Color="Black"/>
<GradientStop Color="{Binding Color}" Offset="0.8"/>
</LinearGradientBrush>
</Path.Fill>
<Path.RenderTransform>
<RotateTransform x:Name="propRotate" Angle="0" />
</Path.RenderTransform>
</Path>
</Grid>
</Border>
</Grid>
<Grid>
<Border BorderBrush="Gray" Cursor="Hand" BorderThickness="1 1 0 1" Margin="0 80" CornerRadius="5 0 0 5" PreviewMouseDown="OnBackwardPressed" PreviewMouseUp="OnBackwardReleased" Style="{StaticResource TechWidgetBorderLeft}">
<Viewbox Stretch="Fill" Margin="-10 20">
<materialDesign:PackIcon Kind="ChevronLeft" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="Gainsboro" />
</Viewbox>
</Border>
</Grid>
<Grid Grid.Column="2">
<Border BorderBrush="Gray" Cursor="Hand" BorderThickness="0 1 1 1" Margin="0 80" CornerRadius="0 10 10 0" PreviewMouseDown="OnForwardPressed" PreviewMouseUp="OnForwardReleased" Style="{StaticResource TechWidgetBorderRight}">
<Viewbox Stretch="Fill" Margin="-10 20">
<materialDesign:PackIcon Kind="ChevronRight" HorizontalAlignment="Center" VerticalAlignment="Center" Width="24" Height="24" Foreground="Gainsboro" />
</Viewbox>
</Border>
</Grid>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="115*"/>
<ColumnDefinition Width="20*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="1">
<Border BorderBrush="Gray" BorderThickness="1 0 1 1" CornerRadius="0 0 20 20" Style="{StaticResource TechWidgetBorderCenterNoHover}">
<Grid>
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Content" Value="{StaticResource gridDefault}">
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsHoming}" Value="True">
<Setter Property="Content" Value="{StaticResource gridHoming}">
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</Grid>
</Border>
</Grid>
</Grid>
</Grid>
</Viewbox>
</Grid>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -65 0">
<Border Background="#1B1B1B" CornerRadius="3" Padding="3">
<mahapps:NumericUpDown BorderThickness="0" Background="Transparent" HideUpDownButtons="True" HasDecimals="False" Minimum="0" Maximum="10000" StringFormat="0" Value="{Binding Speed,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,StringFormat=0,FallbackValue=5000}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" FontSize="22" VerticalAlignment="Center" Foreground="{StaticResource RedBrush400}" FontFamily="{StaticResource digital-7}"></mahapps:NumericUpDown>
</Border>
<visuals:Knob Width="50" Height="50" TicksHighlightBrush="{StaticResource RedBrush400}" KnobType="MetroDark" TicksWidth="2" Margin="0 5 0 0" TicksHeight="5" Minimum="0" Maximum="5000" Value="{Binding Speed,Mode=TwoWay}" />
</StackPanel>
<!--Content-->
<Grid>
<Border Margin="0 0 0 -23" VerticalAlignment="Bottom">
<TextBlock Text="{Binding TechNameFinal}" FontSize="14" Foreground="DimGray" HorizontalAlignment="Center"></TextBlock>
</Border>
</Grid>
<!--Content-->
<Border BorderThickness="1" BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=BorderBrush,TargetNullValue={StaticResource BorderBrush},FallbackValue={StaticResource BorderBrush}}">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=(local:ElementsEditor.IsSelected)}" Value="True" />
<Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Visible"></Setter>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<ContentPresenter Content="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=InnerContent}"></ContentPresenter>
<Thumb Opacity="0" DragDelta="MoveDrag" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
<Thumb HorizontalAlignment="Left" Cursor="SizeWE" Opacity="0" DragDelta="DragLeft" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
<Thumb HorizontalAlignment="Right" Cursor="SizeWE" Opacity="0" DragDelta="DragRight" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
<Thumb VerticalAlignment="Top" Cursor="SizeNS" Opacity="0" DragDelta="DragTop" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
<Thumb VerticalAlignment="Bottom" Cursor="SizeNS" Opacity="0" DragDelta="DragBottom" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
<Grid ClipToBounds="False" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 -20 0 0" Width="10" Height="10">
<Ellipse Stroke="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" StrokeThickness="2"></Ellipse>
<Rectangle HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="0 10 0 -8" StrokeThickness="1" Stroke="Red"></Rectangle>
<Thumb Opacity="0" DragDelta="DragAngle" DragStarted="DragStarted" Cursor="Arrow" DragCompleted="OnDragEnded"></Thumb>
</Grid>
<Grid Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-8 -8 0 0">
<Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="2 2 0 0"></Border>
<Thumb Opacity="0" DragDelta="DragTopLeft" DragStarted="DragStarted" Cursor="SizeNWSE" DragCompleted="OnDragEnded"></Thumb>
</Grid>
<Grid Width="10" Height="10" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -8 -8 0">
<Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="0 2 2 0"></Border>
<Thumb Opacity="0" DragDelta="DragTopRight" DragStarted="DragStarted" Cursor="SizeNESW" DragCompleted="OnDragEnded"></Thumb>
</Grid>
<Grid Width="10" Height="10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -8 -8">
<Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="0 0 2 2"></Border>
<Thumb Opacity="0" DragDelta="DragBottomRight" DragStarted="DragStarted" Cursor="SizeNWSE" DragCompleted="OnDragEnded"></Thumb>
</Grid>
<Grid Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="-8 0 0 -8">
<Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="2 0 0 2"></Border>
<Thumb Opacity="0" DragDelta="DragBottomLeft" DragStarted="DragStarted" Cursor="SizeNESW" DragCompleted="OnDragEnded"></Thumb>
</Grid>
</Grid>
</Border>
</Grid>
</local:ElementEditor>
|