aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
blob: 95f88d1ea9959be07db7b835b6b500291c9317a6 (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
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
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.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Commands;
using Tango.BL.Entities;
using Tango.MachineStudio.Common.Notifications;
using Tango.SharedUI;
using Tango.BL;
using Tango.SharedUI.Components;
using System.Runtime.CompilerServices;
using Tango.MachineStudio.Common;
using Tango.Core.ExtensionMethods;
using Tango.MachineStudio.HardwareDesigner.Views;
using Microsoft.Win32;
using System.IO;
using Tango.BL.ActionLogs;
using Tango.MachineStudio.Common.Authentication;
using Tango.BL.DTO;

namespace Tango.MachineStudio.HardwareDesigner.ViewModels
{
    public class MainViewVM : StudioViewModel
    {
        private INotificationProvider _notification;
        private bool _isNew;
        private ObservablesContext _db;
        private IActionLogManager _actionLogManager;
        private IAuthenticationProvider _authentication;
        private HardwareVersionDTO _hwBeforeSave;

        private HardwareVersion _selectedVersion;
        public HardwareVersion SelectedVersion
        {
            get { return _selectedVersion; }
            set { _selectedVersion = value; RaisePropertyChangedAuto(); OnSelectedVersionChanged(); }
        }

        private HardwareVersion _currentVersion;
        public HardwareVersion CurrentVersion
        {
            get { return _currentVersion; }
            set { _currentVersion = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
        }

        private IObservableEntity _selectedHardwareObject;
        public IObservableEntity SelectedHardwareObject
        {
            get { return _selectedHardwareObject; }
            set
            {
                _selectedHardwareObject = null;
                RaisePropertyChangedAuto();
                _selectedHardwareObject = value;
                RaisePropertyChangedAuto();
                RaisePropertyChanged(nameof(SelectedHardwareObjectTypeName));
            }
        }

        public String SelectedHardwareObjectTypeName
        {
            get
            {
                String name = String.Empty;

                if (SelectedHardwareObject is HardwareMotor)
                {
                    name = (SelectedHardwareObject as HardwareMotor).HardwareMotorType.Description;
                }
                else if (SelectedHardwareObject is HardwareDancer)
                {
                    name = (SelectedHardwareObject as HardwareDancer).HardwareDancerType.Description;
                }
                else if (SelectedHardwareObject is HardwareBlower)
                {
                    name = (SelectedHardwareObject as HardwareBlower).HardwareBlowerType.Description;
                }
                else if (SelectedHardwareObject is HardwareBreakSensor)
                {
                    name = (SelectedHardwareObject as HardwareBreakSensor).HardwareBreakSensorType.Description;
                }
                else if (SelectedHardwareObject is HardwarePidControl)
                {
                    name = (SelectedHardwareObject as HardwarePidControl).HardwarePidControlType.Description;
                }
                else if (SelectedHardwareObject is HardwareSpeedSensor)
                {
                    name = (SelectedHardwareObject as HardwareSpeedSensor).HardwareSpeedSensorType.Description;
                }
                else if (SelectedHardwareObject is HardwareWinder)
                {
                    name = (SelectedHardwareObject as HardwareWinder).HardwareWinderType.Description;
                }

                return name;
            }
        }

        private ObservableCollection<HardwareVersion> _hardwareVersions;
        public ObservableCollection<HardwareVersion> HardwareVersions
        {
            get { return _hardwareVersions; }
            set { _hardwareVersions = value; RaisePropertyChangedAuto(); }
        }

        public RelayCommand SaveCommand { get; set; }

        public RelayCommand DeleteCommand { get; set; }

        public RelayCommand NewCommand { get; set; }

        public RelayCommand CloneCommand { get; set; }

        public RelayCommand CopyParametersCommand { get; set; }

        public RelayCommand OpenComparisonWizardCommand { get; set; }

        public RelayCommand ExportHardwareVersionCommand { get; set; }

        public RelayCommand ImportHardwareVersionCommand { get; set; }

        public MainViewVM(INotificationProvider notification, IActionLogManager actionLogManager, IAuthenticationProvider authentication)
        {
            _notification = notification;
            _actionLogManager = actionLogManager;
            _authentication = authentication;

            CurrentVersion = new HardwareVersion();

            SaveCommand = new RelayCommand(Save, () => SelectedVersion != null && IsFree);
            NewCommand = new RelayCommand(New, () => IsFree);
            DeleteCommand = new RelayCommand(Delete, () => !_isNew && SelectedVersion != null && IsFree);

            CurrentVersion = new HardwareVersion();

            CopyParametersCommand = new RelayCommand(CopyParameters, (x) => SelectedVersion != null && IsFree);
            CloneCommand = new RelayCommand(CloneCurrentVersion, () => SelectedVersion != null && IsFree);

            OpenComparisonWizardCommand = new RelayCommand(OpenComparisonWizard, () => IsFree);
            ExportHardwareVersionCommand = new RelayCommand(ExportHardwareVersion, () => IsFree && SelectedVersion != null && CurrentVersion != null);
            ImportHardwareVersionCommand = new RelayCommand(ImportHardwareVersion, () => IsFree);
        }

        private async void ExportHardwareVersion()
        {
            SaveFileDialog dlg = new SaveFileDialog();
            dlg.Title = "Export hardware version";
            dlg.DefaultExt = ".hv";
            dlg.Filter = "Hardware Version Files|*.hv";

            if (dlg.ShowDialog().Value)
            {
                try
                {
                    var json = await CurrentVersion.ToHardwareVersionFile();
                    File.WriteAllText(dlg.FileName, json);
                }
                catch (Exception ex)
                {
                    LogManager.Log(ex, "Error exporting hardware version.");
                    _notification.ShowError($"An error occurred while trying to export the selected 
<UserControl x:Class="Tango.MachineStudio.Developer.Views.JobView"
             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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:global="clr-namespace:Tango.MachineStudio.Developer"
             xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
             xmlns:brushPicker="clr-namespace:Tango.BrushPicker;assembly=Tango.BrushPicker"
             xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:colorConversion="clr-namespace:Tango.BL.ColorConversion;assembly=Tango.BL"
             xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive"
             xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker"
             xmlns:dispensing="clr-namespace:Tango.BL.Dispensing;assembly=Tango.BL"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner"
             xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels"
             xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:commonConverters="clr-namespace:Tango.MachineStudio.Common.Converters;assembly=Tango.MachineStudio.Common"
             xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI"
             xmlns:video="clr-namespace:Tango.Video.DirectCapture;assembly=Tango.Video"
             xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
             mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}" x:Name="control">

    <UserControl.Resources>

        <sys:Double x:Key="NumbersFontSize">21</sys:Double>

        <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
            <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" />
            <Setter Property="Margin" Value="2" />
        </Style>

        <ResourceDictionary x:Key="SelectAllTextBoxResource">
            <Style TargetType="TextBox">
                <EventSetter Event="GotFocus" Handler="TextBox_GotFocus"></EventSetter>
                <EventSetter Event="MouseDown" Handler="TextBox_PreviewMouseUp"></EventSetter>
            </Style>
        </ResourceDictionary>

        <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
        <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter>
        <converters:BooleanInverseConverter x:Key="BooleanInverseConverter" />
        <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter"></converters:NullObjectToBooleanConverter>
        <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter"></converters:GreaterThanToBooleanConverter>
        <converters:SmallerThanToBooleanConverter x:Key="SmallerThanToBooleanConverter"></converters:SmallerThanToBooleanConverter>
        <localConverters:BrushStopToColorConverter x:Key="BrushStopToColorConverter" />
        <localConverters:BrushStopCMYKToColorConverter x:Key="BrushStopCMYKToColorConverter" />
        <localConverters:BrushStopLabToColorConverter x:Key="BrushStopLabToColorConverter" />
        <localConverters:SegmentToGradientStopsConverter x:Key="SegmentToGradientStopsConverter" />
        <localConverters:BrushStopToOffsetLimitConverter x:Key="BrushStopToOffsetLimitConverter" />
        <localConverters:JobToColumnDefinitionsConverter x:Key="JobToColumnDefinitionsConverter" />
        <localConverters:SegmentLengthToWidthConverter x:Key="SegmentLengthToWidthConverter" />
        <localConverters:SegmentToGradientStopsConverterMulti x:Key="SegmentToGradientStopsConverterMulti" />
        <localConverters:SegmentToBrushConverter x:Key="SegmentToBrushConverter" />
        <localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" />
        <localConverters:ObjectsNotEqualToBooleanConveter x:Key="ObjectsNotEqualToBooleanConveter" />
        <localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" />
        <converters:StringEllipsisConverter x:Key="StringEllipsisConverter" />
        <converters:NumberToFileSizeConverter x:Key="NumberToFileSizeConverter"/>
        <localConverters:OneToPercentConverter x:Key="OneToPercentConverter"/>
        <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
        <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
        <converters:IsNotConverter x:Key="IsNotConverter" />
        <converters:ObjectToObjectTypeConverter x:Key="ObjectToObjectTypeConverter" />
        <converters:MathOperatorConverter x:Key="MathOperatorConverter" />
        <localConverters:LiquidVolumesToLubricantLiquidVolume x:Key="LiquidVolumesToLubricantLiquidVolume" />
        <commonConverters:UserRoleToVisibilityConverter x:Key="UserRoleToVisibilityConverter" />
        <commonConverters:UserRoleToBooleanConverter x:Key="UserRoleToBooleanConverter" />


        <ObjectDataProvider x:Key="dispenserDivisions" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="dispensing:DispenserStepDivisions"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>


        <SolidColorBrush x:Key="SideBarBackground" Color="White">

        </SolidColorBrush>

        <Color x:Key="dummyColor">Transparent</Color>

        <Style x:Key="brushStopBorder" TargetType="Border">
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform>
                </Setter.Value>
            </Setter>
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
            <Setter Property="Background" Value="Transparent"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter>
            <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter>
            <Style.Triggers>
                <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True">
                    <Setter Property="Opacity" Value="0.5"></Setter>
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation>
                                <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                    <Trigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation>
                                <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.ExitActions>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style TargetType="Border" x:Key="JobFieldBorder">
            <Setter Property="BorderBrush" Value="#A5A4A4"></Setter>
            <Setter Property="BorderThickness" Value="0 0 1 1"></Setter>
            <Setter Property="CornerRadius" Value="100 10 100 0"></Setter>
            <Setter Property="Padding" Value="10 5 10 5"></Setter>
            <Setter Property="Margin" Value="0 0 10 0"></Setter>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                        <GradientStop Color="#00E6E6E6"/>
                        <GradientStop Color="#DEDEDE" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="ContentControl" x:Key="colorPicker">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid>
                            <ToggleButton Cursor="Hand" x:Name="PopupButton" Checked="PopupButton_Checked" Unchecked="PopupButton_Unchecked" BorderThickness="0" Height="30" Background="Transparent" Foreground="{StaticResource AccentColorBrush}" VerticalAlignment="Center" Margin="30 0 0 0" IsChecked="{Binding ElementName=Popup, Path=IsOpen}">
                                <ToggleButton.Style>
                                    <Style TargetType="ToggleButton" BasedOn="{StaticResource emptyToggleButton}">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding IsOpen, ElementName=Popup}" Value="True">
                                                <Setter Property="IsEnabled" Value="False" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </ToggleButton.Style>

                                <StackPanel Orientation="Horizontal">
                                    <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil" Width="32" Height="32">
                                        <materialDesign:PackIcon.Foreground>
                                            <SolidColorBrush Color="{Binding Color}"></SolidColorBrush>
                                        </materialDesign:PackIcon.Foreground>
                                    </materialDesign:PackIcon>
                                    <TextBlock Margin="5 0 0 0" FontSize="14" VerticalAlignment="Center">SELECT COLOR</TextBlock>
                                </StackPanel>
                            </ToggleButton>
                            <Popup x:Name="Popup" MouseDown="Popup_MouseDown" PopupAnimation="Fade" StaysOpen="False" PlacementTarget="{Binding ElementName=PopupButton}"  Placement="Bottom" AllowsTransparency="True">
                                <Border Background="#E6FFFFFF" CornerRadius="5" Margin="10">
                                    <Border.Effect>
                                        <DropShadowEffect ShadowDepth="0" BlurRadius="10" />
                                    </Border.Effect>
                                    <Grid>
                                        <Grid Margin="10">
                                            <DockPanel>
                                                <DockPanel>
                                                    <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center">SOURCE</TextBlock>
                                                    <Viewbox Width="300" Height="180" VerticalAlignment="Center" Stretch="Fill">
                                                        <colorPicker:ColorCanvas SelectedColor="{Binding Color,Mode=TwoWay}" SelectedColorChanged="ColorCanvas_SelectedColorChanged" Background="Transparent" BorderThickness="0" Height="150" Width="230" ></colorPicker:ColorCanvas>
                                                    </Viewbox>
                                                </DockPanel>
                                                <Image DockPanel.Dock="Left" Source="../Images/arrow-long-right.png" VerticalAlignment="Center" Width="30" Margin="10 0"></Image>

                                                <DockPanel>
                                                    <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center">SUGGESTIONS</TextBlock>
                                                    <hive:HexList VerticalAlignment="Center" Margin="0 10 0 0" Width="220" Height="270" UseHexItemHasContainer="True" Grid.Column="2" Grid.Row="1" RowCount="6" ColumnCount="5" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.HiveSuggestions}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedSuggestion,Mode=TwoWay}">
                                                        <hive:HexList.ItemContainerStyle>
                                                            <Style TargetType="hive:HexItem" BasedOn="{StaticResource {x:Type hive:HexItem}}">
                                                                <Setter Property="Background" Value="{Binding Brush}"></Setter>
                                                                <Setter Property="Grid.Column" Value="0"></Setter>
                                                                <Setter Property="Grid.Row" Value="0"></Setter>
                                                                <Setter Property="Background" Value="Transparent"></Setter>
                                                                <Setter Property="BorderThickness" Value="1"></Setter>
                                                                <Setter Property="ToolTip">
                                                                    <Setter.Value>
                                                                        <ToolTip Background="White">
                                                                            <ItemsControl ItemsSource="{Binding Coordinates.OutputLiquids}">
                                                                                <ItemsControl.ItemsPanel>
                                                                                    <ItemsPanelTemplate>
                                                                                        <StackPanel Orientation="Horizontal"></StackPanel>
                                                                                    </ItemsPanelTemplate>
                                                                                </ItemsControl.ItemsPanel>
                                                                                <ItemsControl.ItemTemplate>
                                                                                    <DataTemplate>
                                                                                        <TextBlock TextAlignment="Center" Foreground="#202020" Margin="10 0">
                                                                                            <Run Text="{Binding LiquidType}"></Run>
                                                                                            <LineBreak/>
                                                                                            <Run Text="{Binding Volume,StringFormat=0}"></Run>
                                                                                        </TextBlock>
                                                                                    </DataTemplate>
                                                                                </ItemsControl.ItemTemplate>
                                                                            </ItemsControl>
                                                                        </ToolTip>
                                                                    </Setter.Value>
                                                                </Setter>

                                                                <Style.Triggers>
                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=DataContext,Converter={StaticResource ObjectToObjectTypeConverter}}" Value="{x:Type colorConversion:ColorConversionSuggestion}">
                                                                        <Setter Property="Grid.Column" Value="{Binding Column}"></Setter>
                                                                        <Setter Property="Grid.Row" Value="{Binding Row}"></Setter>
                                                                        <Setter Property="Background" Value="{Binding Brush}"></Setter>
                                                                    </DataTrigger>
                                                                    <Trigger Property="IsSelected" Value="True">
                                                                        <Setter Property="BorderThickness" Value="2"></Setter>
                                                                    </Trigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </hive:HexList.ItemContainerStyle>

                                                        <hive:HexList.ItemTemplate>
                                                            <DataTemplate>

                                                            </DataTemplate>
                                                        </hive:HexList.ItemTemplate>
                                                    </hive:HexList>
                                                </DockPanel>
                                            </DockPanel>
                                        </Grid>
                                    </Grid>
                                </Border>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <DataTemplate x:Key="Volume_Template">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                <StackPanel VerticalAlignment="Center">
                    <ItemsControl VerticalAlignment="Center">
                        <ItemsControl.Style>
                            <Style TargetType="ItemsControl">
                                <Setter Property="ItemsSource" Value="{Binding LiquidVolumes}"></Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Settings.UsePreferredLiquidVolumeIndex}" Value="True">
                                        <Setter Property="ItemsSource" Value="{Binding LiquidVolumesOrdered}"></Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ItemsControl.Style>
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel>
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Border>
                                    <Border.Style>
                                        <Style TargetType="Border">
                                            <Setter Property="Visibility" Value="Visible"></Setter>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding IdsPack.IdsPackFormula.Name}" Value="Lubricant">
                                                    <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Border.Style>
                                    <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Margin="10 0 0 0" Width="60" Height="60">
                                        <ContentControl.Foreground>
                                            <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush>
                                        </ContentControl.Foreground>
                                        <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                                            <mahapps:NumericUpDown.Resources>
                                                <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource>
                                            </mahapps:NumericUpDown.Resources>
                                        </mahapps:NumericUpDown>
                                    </ContentControl>
                                </Border>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>

                    <StackPanel Orientation="Horizontal" Margin="30 10 0 0" Height="16" Visibility="{Binding IsLiquidVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}">
                        <materialDesign:PackIcon Kind="Alert" Foreground="#FFAC3C" />
                        <TextBlock Margin="5 0 0 0" Foreground="#FFAC3C">Liquid volumes exceeds the maximum range for color conversion!</TextBlock>
                    </StackPanel>
                </StackPanel>

                <materialDesign:PackIcon Kind="ChevronDoubleLeft" Margin="40 2 0 0" VerticalAlignment="Center" Foreground="Gray" />

                <TextBlock VerticalAlignment="Center" FontSize="16" Margin="5 0 0 0" FontStyle="Italic" Foreground="Gray">
                                                                                                                            <Run>Total:</Run>
                                                                                                                            <Run Text="{Binding TotalLiquidVolume,Mode=OneWay,StringFormat=0}"></Run><Run>%</Run>
                                                                                                                            <Run>(</Run>
                                                                                                                            <Run FontSize="10" Text="{Binding TotalLiquidNanoliterPerCentimeter,Mode=OneWay,StringFormat=0.00}"></Run>
                                                                                                                            <Run FontSize="12">nl</Run>
                                                                                                                            <Run>)</Run>
                </TextBlock>

                <Border Margin="60 0 0 0" DataContext="{Binding LiquidVolumes,Converter={StaticResource LiquidVolumesToLubricantLiquidVolume}}" BorderBrush="#E6E6E6" BorderThickness="1 0 0 0">
                    <Border.Style>
                        <Style TargetType="Border">
                            <Setter Property="Visibility" Value="Collapsed"></Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Converter={StaticResource NullObjectToBooleanConverter}}" Value="True">
                                    <Setter Property="Visibility" Value="Visible"></Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Border.Style>
                    <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Margin="10 0 0 0" Width="55" Height="55">
                        <ContentControl.Foreground>
                            <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush>
                        </ContentControl.Foreground>
                        <mahapps:NumericUpDown Foreground="#515151" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontSize="20" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                            <mahapps:NumericUpDown.Resources>
                                <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource>
                            </mahapps:NumericUpDown.Resources>
                        </mahapps:NumericUpDown>
                    </ContentControl>
                </Border>
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="RGB_Template">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF6F6F" Width="60" Height="60" Margin="10 0 0 0">
                        <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
                            <mahapps:NumericUpDown.Resources>
                                <Style TargetType="TextBox"/>
                            </mahapps:NumericUpDown.Resources>
                        </mahapps:NumericUpDown>
                    </ContentControl>

                    <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="60" Height="60" Margin="10 0 0 0">
                        <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
                            <mahapps:NumericUpDown.Resources>
                                <Style TargetType="TextBox"/>
                            </mahapps:NumericUpDown.Resources>
                        </mahapps:NumericUpDown>
                    </ContentControl>

                    <ContentControl Style="{StaticResource numberBorder}" Foreground="#3C7EF4" BorderThickness="1" Width="60" Height="60" Margin="10 0 0 0">
                        <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center">
                            <mahapps:NumericUpDown.Resources>
                                <Style TargetType="TextBox"/>
                            </mahapps:NumericUpDown.Resources>
                        </mahapps:NumericUpDown>
                    </ContentControl>

                    <ContentControl Style="{StaticResource colorPicker}"></ContentControl>
                </StackPanel>

                <StackPanel Orientation="Horizontal" Margin="30 10 0 0" Height="16" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}">
                    <materialDesign:PackIcon Kind="Alert" Foreground="#FF6D6D" />
                    <TextBlock Margin="5 0 0 0" Foreground="#FF6D6D">Color is out of gamut!</TextBlock>
                </StackPanel>
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="LAB_Template">
            <StackPanel Orientation="Horizontal">
                <ContentControl Style="{StaticResource numberBorder}" Foreground="Gray" Width="60" Height="60" Margin="10 0 0 0">
                    <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                        <mahapps:NumericUpDown.Resources>
                            <Style TargetType="TextBox"/>
                        </mahapps:NumericUpDown.Resources>
                    </mahapps:NumericUpDown>
                </ContentControl>

                <ContentControl Style="{StaticResource numberBorder}" Foreground="#FF8A8A" Width="60" Height="60" Margin="10 0 0 0">
                    <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                        <mahapps:NumericUpDown.Resources>
                            <Style TargetType="TextBox"/>
                        </mahapps:NumericUpDown.Resources>
                    </mahapps:NumericUpDown>
                </ContentControl>

                <ContentControl Style="{StaticResource numberBorder}" Foreground="#92FF92" Width="60" Height="60" Margin="10 0 0 0">
                    <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-128" Maximum="128" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                        <mahapps:NumericUpDown.Resources>
                            <Style TargetType="TextBox"/>
                        </mahapps:NumericUpDown.Resources>
                    </mahapps:NumericUpDown>
                </ContentControl>

                <ContentControl Style="{StaticResource colorPicker}"></ContentControl>
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="CMYK_Template">
            <StackPanel Orientation="Horizontal">
                <ContentControl Style="{StaticResource numberBorder}" Foreground="Cyan" Width="60" Height="60" Margin="10 0 0 0">
                    <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Cyan,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                        <mahapps:NumericUpDown.Resources>
                            <Style TargetType="TextBox"/>
                        </mahapps:NumericUpDown.Resources>
                    </mahapps:NumericUpDown>
                </ContentControl>

                <ContentControl Style="{StaticResource numberBorder}" Foreground="Magenta" Width="60" Height="60" Margin="10 0 0 0">
                    <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Magenta,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                        <mahapps:NumericUpDown.Resources>
                            <Style TargetType="TextBox"/>
                        </mahapps:NumericUpDown.Resources>
                    </mahapps:NumericUpDown>
                </ContentControl>

                <ContentControl Style="{StaticResource numberBorder}" Foreground="Yellow" Width="60" Height="60" Margin="10 0 0 0">
                    <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Yellow,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                        <mahapps:NumericUpDown.Resources>
                            <Style TargetType="TextBox"/>
                        </mahapps:NumericUpDown.Resources>
                    </mahapps:NumericUpDown>
                </ContentControl>

                <ContentControl Style="{StaticResource numberBorder}" Foreground="Black" Width="60" Height="60" Margin="10 0 0 0">
                    <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
                        <mahapps:NumericUpDown.Resources>
                            <Style TargetType="TextBox"/>
                        </mahapps:NumericUpDown.Resources>
                    </mahapps:NumericUpDown>
                </ContentControl>

                <ContentControl Style="{StaticResource colorPicker}"></ContentControl>
            </StackPanel>
        </DataTemplate>

    </UserControl.Resources>

    <Grid IsEnabled="{Binding IsFree}">
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>

            <Grid Margin="0 10 10 0" Grid.Column="2">
                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="1*" />
                    </Grid.ColumnDefinitions>

                    <Grid Background="#96FFFFFF">
                        <Grid.Style>
                            <Style TargetType="Grid">
                                <Setter Property="Width" Value="304"></Setter>
                                <Setter Property="LayoutTransform">
                                    <Setter.Value>
                                        <ScaleTransform ScaleY="1" ScaleX="1"></ScaleTransform>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True">
                                        <DataTrigger.EnterActions>
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </DataTrigger.EnterActions>
                                        <DataTrigger.ExitActions>
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </DataTrigger.ExitActions>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Grid.Style>
                        <DockPanel>
                            <Border DockPanel.Dock="Bottom" Margin="10">
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                    <Button Command="{Binding DuplicateSegmentCommand}" Margin="0 0 4 0" Background="#FF9A6A" BorderBrush="#FF9A6A" Height="42" Padding="10" ToolTip="Duplicate Segment">
                                        <StackPanel Orientation="Horizontal">
                                            <materialDesign:PackIcon Kind="ContentCopy" Width="24" Height="24"></materialDesign:PackIcon>
                                            <TextBlock VerticalAlignment="Center">Duplicate</TextBlock>
                                        </StackPanel>
                                    </Button>
                                    <Button Command="{Binding RemoveSegmentCommand}" Margin="0 0 4 0" Background="#FF6A6A" BorderBrush="#FF6A6A" Height="42" Padding="10" ToolTip="Remove Segment">
                                        <StackPanel Orientation="Horizontal">
                                            <materialDesign:PackIcon Kind="Delete" Width="24" Height="24"></materialDesign:PackIcon>
                                            <TextBlock VerticalAlignment="Center">Remove</TextBlock>
                                        </StackPanel>
                                    </Button>
                                    <Button AutomationProperties.AutomationId="{x:Static automation:Developer.AddSegmentButton}" Command="{Binding AddSegmentCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10" ToolTip="Add Segment">
                                        <StackPanel Orientation="Horizontal">
                                            <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon>
                                            <TextBlock VerticalAlignment="Center">New</TextBlock>
                                        </StackPanel>
                                    </Button>
                                </StackPanel>
                            </Border>

                            <controls:MultiSelectListBox FocusVisualStyle="{x:Null}" x:Name="listBoxSegments" MouseEnter="listBoxSegments_MouseEnter" PreviewMouseDown="listBoxSegments_PreviewMouseDown" AutomationProperties.AutomationId="{x:Static automation:Developer.SegmentsListBox}" Style="{StaticResource {x:Type ListBox}}" SelectionMode="Extended" SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SegmentsCollectionView}" SelectedItem="{Binding SelectedSegment}" SelectedItemsList="{Binding SelectedSegments,Mode=TwoWay}" HorizontalContentAlignment="Stretch" Padding="0 0 0 0">
                                <ListBox.ItemContainerStyle>
                                    <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">
                                        <EventSetter Event="PreviewMouseDown" Handler="ListBoxItem_PreviewMouseDown"></EventSetter>
                                    </Style>
                                </ListBox.ItemContainerStyle>
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <Grid Margin="5 10" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnSegmentDrop">
                                            <Polygon Points="40,0 290,0 290,100 0,100 0,30" StrokeThickness="0.2" IsHitTestVisible="False" Stretch="Fill">
                                                <Polygon.Effect>
                                                    <DropShadowEffect Opacity="0.5" />
                                                </Polygon.Effect>
                                                <Polygon.Style>
                                                    <Style TargetType="Polygon">
                                                        <Setter Property="Stroke" Value="Black"></Setter>
                                                        <Setter Property="Fill">
                                                            <Setter.Value>
                                                                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                                    <GradientStop Color="#00EEEEEE" Offset="0" />
                                                                    <GradientStop Color="#FFB5B5B5" Offset="1" />
                                                                </LinearGradientBrush>
                                                            </Setter.Value>
                                                        </Setter>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True">
                                                                <Setter Property="Stroke" Value="Black"></Setter>
                                                                <Setter Property="Fill">
                                                                    <Setter.Value>
                                                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                                            <GradientStop Color="White" Offset="0" />
                                                                            <GradientStop Color="{StaticResource AccentColor}" Offset="2" />
                                                                        </LinearGradientBrush>
                                                                    </Setter.Value>
                                                                </Setter>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Polygon.Style>
                                            </Polygon>
                                            <Border Height="100" Padding="5" IsHitTestVisible="False">
                                                <Grid>
                                                    <Rectangle VerticalAlignment="Bottom" Height="8" Fill="{Binding SegmentBrush}">

                                                    </Rectangle>
                                                </Grid>
                                            </Border>

                                            <Grid Margin="20 10 10 10" TextElement.FontSize="16" TextElement.FontStyle="Italic" >
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto" />
                                                    <ColumnDefinition Width="1*" />
                                                </Grid.ColumnDefinitions>

                                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                                    <TextBlock FontWeight="SemiBold">#</TextBlock>
                                                    <TextBlock FontWeight="SemiBold" Margin="5 0 0 0" Text="{Binding SegmentIndex}"></TextBlock>
                                                </StackPanel>


                                                <TextBox Grid.Column="1" CaretBrush="Transparent" Cursor="Arrow" VerticalAlignment="Center" Width="200" HorizontalContentAlignment="Center" Style="{x:Null}" BorderThickness="0" Background="Transparent" Text="{Binding Name}"></TextBox>
                                            </Grid>

                                        </Grid>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </controls:MultiSelectListBox>
                        </DockPanel>

                        <Rectangle HorizontalAlignment="Right" StrokeThickness="1" Width="3" Margin="0 0 0 0">
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                    <GradientStop Offset="0" Color="#ECECEC" />
                                    <GradientStop Offset="0.5" Color="Black" />
                                    <GradientStop Offset="1.1" Color="Black" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                            <Rectangle.Stroke>
                                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                    <GradientStop Offset="0" Color="White" />
                                    <GradientStop Offset="0.5" Color="White" />
                                    <GradientStop Offset="1" Color="White" />
                                </LinearGradientBrush>
                            </Rectangle.Stroke>
                        </Rectangle>
                    </Grid>

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

                        <Grid>
                            <StackPanel>
                                <Grid>
                                    <StackPanel Orientation="Horizontal" Margin="10">
                                        <Image Source="../Images/rgb.png" Width="24"></Image>
                                        <TextBlock Margin="5 0 0 0" Text="{Binding ActiveJob.Name,FallbackValue='UNSET'}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock>
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal" Margin="0 5 0 0" HorizontalAlignment="Right">
                                        <TextBlock Margin="0 0 5 0" Text="{Binding ActiveJob.CreationDate,FallbackValue='UNSET'}" FontSize="12" Foreground="Gray" FontStyle="Italic" VerticalAlignment="Center"></TextBlock>
                                        <Image Source="../Images/calendar.png" Width="16"></Image>
                                    </StackPanel>
                                </Grid>

                                <StackPanel Orientation="Horizontal" Margin="10 20 0 0" MaxWidth="1360" HorizontalAlignment="Left">
                                    <Border Style="{StaticResource JobFieldBorder}">
                                        <StackPanel Margin="5" Width="140">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="../Images/name.png" Width="32"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock>
                                            </StackPanel>
                                            <TextBox Margin="0 3 0 0" Width="100" HorizontalAlignment="Left" Text="{Binding ActiveJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                                        </StackPanel>
                                    </Border>

                                    <Border Style="{StaticResource JobFieldBorder}">
                                        <StackPanel Margin="10 5 5 5" Width="140">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="../Images/wind.png" Width="32"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock>
                                            </StackPanel>
                                            <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding WindingMethods}" SelectedItem="{Binding ActiveJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox>
                                        </StackPanel>
                                    </Border>

                                    <Border Style="{StaticResource JobFieldBorder}">
                                        <StackPanel Margin="10 5 5 5" Width="140">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="../Images/thread.png" Width="32"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Spool</TextBlock>
                                            </StackPanel>
                                            <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding SpoolTypes}" SelectedItem="{Binding ActiveJob.SpoolType}" >
                                                <ComboBox.ToolTip>
                                                    <TextBlock>
                                                            <Run Text="{Binding ActiveJob.SpoolType.Name}"></Run>
                                                            <Run FontSize="9" Foreground="#D9D9D9" Text="{Binding ActiveJob.SpoolType.Length,Mode=OneWay}"></Run>
                                                            <Run FontSize="9" Foreground="#DEDEDE" Text="m"></Run>
                                                    </TextBlock>
                                                </ComboBox.ToolTip>
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock TextTrimming="CharacterEllipsis">
                                                            <Run Text="{Binding Name}"></Run>
                                                            <Run FontSize="9" Foreground="Gray" Text="{Binding Length,Mode=OneWay}"></Run>
                                                            <Run FontSize="9" Foreground="Gray" Text="m"></Run>
                                                        </TextBlock>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>
                                        </StackPanel>
                                    </Border>

                                    <Border Style="{StaticResource JobFieldBorder}">
                                        <StackPanel Margin="20 5 5 5"  Width="140">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="../Images/inter-segment.png" Width="32"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Inter Segment</TextBlock>
                                            </StackPanel>
                                            <DockPanel LastChildFill="True">
                                                <ToggleButton Margin="10 0 25 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding ActiveJob.EnableInterSegment}"></ToggleButton>
                                                <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" Width="70" HorizontalAlignment="Left" StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding ActiveJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown>
                                            </DockPanel>
                                        </StackPanel>
                                    </Border>

                                    <Border Style="{StaticResource JobFieldBorder}">
                                        <StackPanel Margin="20 5 5 5"  Width="140">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="../Images/lubrication.png" Width="32"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Lubrication</TextBlock>
                                            </StackPanel>
                                            <DockPanel LastChildFill="True" Margin="0 10 30 0">
                                                <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding ActiveJob.EnableLubrication}"></ToggleButton>
                                            </DockPanel>
                                        </StackPanel>
                                    </Border>

                                    <Border Style="{StaticResource JobFieldBorder}">
                                        <StackPanel Margin="20 5 5 5"  Width="140">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="../Images/repeat.png" Width="32"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Units</TextBlock>
                                            </StackPanel>
                                            <mahapps:NumericUpDown FontSize="{StaticResource NumbersFontSize}" Width="70" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" Margin="0 5 0 0" HideUpDownButtons="True" Minimum="1" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.NumberOfUnits,Mode=TwoWay}"></mahapps:NumericUpDown>
                                        </StackPanel>
                                    </Border>

                                    <Border Style="{StaticResource JobFieldBorder}" Height="82" Width="200" Visibility="{Binding IsSideBarOpened,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                                        <StackPanel Width="200">
                                            <StackPanel Orientation="Horizontal" Margin="10 0 0 0">
                                                <Image Source="../Images/description.png" Width="32"></Image>
                                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Description</TextBlock>
                                            </StackPanel>

                                            <Border BorderThickness="0" BorderBrush="Silver" CornerRadius="5" Margin="0 0 5 5">
                                                <TextBox Padding="5 0 0 0" FontStyle="Italic" Background="Transparent" Style="{x:Null}" BorderThickness="0" Margin="5" Height="40" Text="{Binding ActiveJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
                                            </Border>
                                        </StackPanel>
                                    </Border>
                                </StackPanel>


                            </StackPanel>

                            <Grid HorizontalAlignment="Right" Margin="0 0 10 0">
                                <StackPanel Orientation="Horizontal">
                                    <Button AutomationProperties.AutomationId="{x:Static automation:Developer.ToJobsButton}" Height="70" Width="100" Margin="0 0 10 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020"  VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding DiscardJobCommand}">
                                        <StackPanel>
                                            <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="KeyboardBackspace" />
                                            <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">TO JOBS</TextBlock>
                                        </StackPanel>
                                    </Button>
                                    <Button AutomationProperties.AutomationId="{x:Static automation:Developer.SaveJobButton}" Height="70" Width="100" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="#202020"  VerticalAlignment="Bottom" BorderBrush="Transparent" Command="{Binding SaveJobCommand}">
                                        <StackPanel>
                                            <materialDesign:PackIcon HorizontalAlignment="Center" Width="24" Height="24" Kind="ContentSave" />
                                            <TextBlock VerticalAlignment="Center" Margin="0 10 0 0">SAVE JOB</TextBlock>
                                        </StackPanel>
                                    </Button>
                                </StackPanel>
                            </Grid>
                        </Grid>
                        <Grid Grid.Row="1" Margin="0 20 0 0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="1*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid>

                                <Grid Grid.Column="1" Margin="10 5 0 0">
                                    <DockPanel>
                                        <Grid Margin="0 10 0 0">
                                            <DockPanel>
                                                <Grid DockPanel.Dock="Top">
                                                    <Grid>
                                                        <StackPanel Orientation="Horizontal">
                                                            <Border Style="{StaticResource JobFieldBorder}">
                                                                <StackPanel Margin="5" Width="140">
                                                                    <StackPanel Orientation="Horizontal">
                                                                        <Image Source="../Images/ruler.png" Width="32"></Image>
                                                                        <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Segment Length</TextBlock>
                                                                    </StackPanel>
                                                                    <mahapps:NumericUpDown x:Name="numSegmentLength" FontSize="{StaticResource NumbersFontSize}" HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                                                                        <mahapps:NumericUpDown.Resources>
                                                                            <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource>
                                                                        </mahapps:NumericUpDown.Resources>
                                                                    </mahapps:NumericUpDown>
                                                                </StackPanel>
                                                            </Border>

                                                            <Grid Margin="20 10 0 0">
                                                                <StackPanel>
                                                                    <TextBlock>MEDIA</TextBlock>
                                                                    <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
                                                                        <ComboBox Width="250" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}">
                                                                            <ComboBox.ItemTemplate>
                                                                                <DataTemplate>
                                                                                    <StackPanel>
                                                                                        <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic"></TextBlock>
                                                                                        <TextBlock FontSize="11" Text="{Binding Manufacturer}" Foreground="Gray"></TextBlock>
                                                                                    </StackPanel>
                                                                                </DataTemplate>
                                                                            </ComboBox.ItemTemplate>
                                                                        </ComboBox>

                                                                        <!--<Button  Margin="20 30 0 0" Command="{Binding EditRMLCommand}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}">
                                                                            <StackPanel Orientation="Horizontal">
                                                                                <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon>
                                                                                <TextBlock Margin="10 0 0 0">EDIT MEDIA</TextBlock>
                                                                            </StackPanel>
                                                                        </Button>-->




                                                                    </StackPanel>
                                                                </StackPanel>


                                                            </Grid>


                                                        </StackPanel>

                                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 40 180 0">
                                                            <materialDesign:PackIcon Kind="ChevronLeft" Width="24" Height="24" />
                                                            <TextBlock  Margin="0 -2 0 0" VerticalAlignment="Center"><Run>SUPPORTED MEDIA LIQUID</Run> <Run FontSize="10"  Foreground="DimGray">( Max Nanolitter/CM )</Run></TextBlock>
                                                            <materialDesign:PackIcon Kind="ChevronRight" Width="24" Height="24" />
                                                        </StackPanel>

                                                        <Grid HorizontalAlignment="Right" Margin="0 0 0 0">
                                                            <StackPanel HorizontalAlignment="Right" Margin="0 0 0 0">
                                                                <StackPanel Margin="0 10 0 0"  Orientation="Horizontal" VerticalAlignment="Center">
                                                                    <ItemsControl ItemsSource="{Binding LiquidTypesRmls}" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}">
                                                                        <ItemsControl.ItemsPanel>
                                                                            <ItemsPanelTemplate>
                                                                                <WrapPanel IsItemsHost="True"></WrapPanel>
                                                                            </ItemsPanelTemplate>
                                                                        </ItemsControl.ItemsPanel>
                                                                        <ItemsControl.ItemTemplate>
                                                                            <DataTemplate DataType="{x:Type observables:LiquidTypesRml}">
                                                                                <StackPanel Margin="0 0 10 0">
                                                                                    <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="DimGray" Text="{Binding LiquidType.Name}"></TextBlock>
                                                                                    <Grid Width="58" Height="48" Margin="0 5 0 0">
                                                                                        <shapes:Hexagon StrokeThickness="1" Stroke="Gray">
                                                                                            <shapes:Hexagon.Fill>
                                                                                                <LinearGradientBrush Opacity="0.7" >
                                                                                                    <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/>
                                                                                                    <GradientStop Color="White" Offset="1"/>
                                                                                                </LinearGradientBrush>
                                                                                            </shapes:Hexagon.Fill>
                                                                                        </shapes:Hexagon>

                                                                                        <TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox>
                                                                                    </Grid>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </ItemsControl.ItemTemplate>
                                                                    </ItemsControl>

                                                                    <StackPanel Margin="0 20 0 0">
                                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 0 0 5" ToolTip="Sort the liquid volumes by their liquid type preferred index">
                                                                            <Viewbox Width="25">
                                                                                <ToggleButton IsChecked="{Binding Settings.UsePreferredLiquidVolumeIndex}" />
                                                                            </Viewbox>
                                                                            <TextBlock Margin="5 0 0 0" FontSize="10">Use Preferred Index</TextBlock>
                                                                        </StackPanel>
                                                                        <Button  Command="{Binding SaveLiquidFactorsCommand}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}">
                                                                            <StackPanel Orientation="Horizontal">
                                                                                <materialDesign:PackIcon VerticalAlignment="Center" Kind="Harddisk"></materialDesign:PackIcon>
                                                                                <TextBlock Margin="10 0 0 0">SAVE FACTORS</TextBlock>
                                                                            </StackPanel>
                                                                        </Button>
                                                                    </StackPanel>
                                                                </StackPanel>
                                                            </StackPanel>
                                                        </Grid>
                                                    </Grid>
                                                </Grid>

                                                <Border DockPanel.Dock="Bottom" Margin="10">
                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                        <Button Command="{Binding DuplicateBrushStopCommand}" Margin="0 0 4 0" Background="#FF9A6A" BorderBrush="#FF9A6A" Height="42" Padding="10">
                                                            <StackPanel Orientation="Horizontal">
                                                                <materialDesign:PackIcon Kind="ContentCopy" Width="24" Height="24"></materialDesign:PackIcon>
                                                                <TextBlock VerticalAlignment="Center">Duplicate</TextBlock>
                                                            </StackPanel>
                                                        </Button>
                                                        <Button Command="{Binding RemoveBrushStopCommand}" Margin="0 0 4 0" Background="#FF6A6A" BorderBrush="#FF6A6A" Height="42" Padding="10">
                                                            <StackPanel Orientation="Horizontal">
                                                                <materialDesign:PackIcon Kind="Delete" Width="24" Height="24"></materialDesign:PackIcon>
                                                                <TextBlock VerticalAlignment="Center">Remove</TextBlock>
                                                            </StackPanel>
                                                        </Button>
                                                        <Button AutomationProperties.AutomationId="{x:Static automation:Developer.AddBrushStopButton}" Command="{Binding AddBrushStopCommand}" Background="#68B367" BorderBrush="#68B367" Height="42" Padding="10">
                                                            <StackPanel Orientation="Horizontal">
                                                                <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon>
                                                                <TextBlock VerticalAlignment="Center">New</TextBlock>
                                                            </StackPanel>
                                                        </Button>
                                                    </StackPanel>
                                                </Border>

                                                <Grid Margin="0 40 0 0">
                                                    <DockPanel>
                                                        <Grid DockPanel.Dock="Top">
                                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                                                <Image Source="../Images/color-palette.png" Width="42"></Image>
                                                                <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">SEGMENT BRUSH</TextBlock>
                                                            </StackPanel>

                                                            <DockPanel>
                                                                <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 0 0 0">
                                                                    <TextBlock VerticalAlignment="Center" Foreground="DimGray">Generate Gradient</TextBlock>
                                                                    <ToggleButton Margin="10 0 0 0" IsChecked="{Binding Settings.EnableGradientGeneration,Mode=TwoWay}" />
                                                                    <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Foreground="DimGray">Resolution:</TextBlock>
                                                                    <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontSize="14" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N0} cm" Margin="5 1 0 0" Minimum="10" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Settings.GradientResolutionCM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
                                                                        <mahapps:NumericUpDown.Resources>
                                                                            <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource>
                                                                        </mahapps:NumericUpDown.Resources>
                                                                    </mahapps:NumericUpDown>
                                                                </StackPanel>
                                                                <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="15" Margin="200 0 10 0" StrokeThickness="1" Stroke="Gainsboro">
                                                                    <Rectangle.Fill>
                                                                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,0" x:Name="gradientBrush"></LinearGradientBrush>
                                                                    </Rectangle.Fill>
                                                                </Rectangle>
                                                            </DockPanel>
                                                        </Grid>
                                                        <Grid Margin="0 10 10 0">
                                                            <controls:MultiSelectListBox AutomationProperties.AutomationId="{x:Static automation:Developer.BrushStopsListBox}" SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding BrushStopsCollectionView}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch">
                                                                <ListBox.ItemContainerStyle>
                                                                    <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">

                                                                    </Style>
                                                                </ListBox.ItemContainerStyle>
                                                                <ItemsControl.ItemTemplate>
                                                                    <DataTemplate DataType="{x:Type observables:BrushStop}">

                                                                        <StackPanel Margin="0 0 0 5">
                                                                            <Border BorderThickness="1" CornerRadius="5" Padding="10" dragAndDrop:DragAndDropService.Drop="OnBrushStopBorderDrop">
                                                                                <Border.Style>
                                                                                    <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}">
                                                                                        <Setter Property="BorderBrush" Value="#B5B5B5"></Setter>
                                                                                        <Setter Property="Background" Value="#70FFFFFF"></Setter>
                                                                                        <Style.Triggers>
                                                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True">
                                                                                                <Setter Property="BorderBrush" Value="Gainsboro"></Setter>
                                                                                                <Setter Property="Background" Value="{StaticResource SideBarBackground}"></Setter>
                                                                                            </DataTrigger>
                                                                                        </Style.Triggers>
                                                                                    </Style>
                                                                                </Border.Style>
                                                                                <Grid>
                                                                                    <DockPanel>
                                                                                        <ContentControl DockPanel.Dock="Left" Content="{Binding}">
                                                                                            <ContentControl.Style>
                                                                                                <Style TargetType="ContentControl">
                                                                                                    <Setter Property="ContentTemplate">
                                                                                                        <Setter.Value>
                                                                                                            <DataTemplate/>
                                                                                                        </Setter.Value>
                                                                                                    </Setter>
                                                                                                    <Style.Triggers>
                                                                                                        <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Volume">
                                                                                                            <Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" />
                                                                                                        </DataTrigger>
                                                                                                        <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB">
                                                                                                            <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" />
                                                                                                        </DataTrigger>
                                                                                                        <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK">
                                                                                                            <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" />
                                                                                                        </DataTrigger>
                                                                                                        <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB">
                                                                                                            <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" />
                                                                                                        </DataTrigger>
                                                                                                    </Style.Triggers>
                                                                                                </Style>
                                                                                            </ContentControl.Style>
                                                                                        </ContentControl>

                                                                                        <Grid DockPanel.Dock="Right">
                                                                                            <Border Style="{StaticResource JobFieldBorder}">
                                                                                                <StackPanel Margin="5" Width="140">
                                                                                                    <StackPanel Orientation="Horizontal">
                                                                                                        <Image Source="../Images/colorspace.png" Width="24"></Image>
                                                                                                        <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Color Space</TextBlock>
                                                                                                    </StackPanel>
                                                                                                    <ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name" Width="100" HorizontalAlignment="Left">
                                                                                                        <ComboBox.ItemContainerStyle>
                                                                                                            <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
                                                                                                                <Setter Property="Background" Value="#ECECEC"></Setter>
                                                                                                            </Style>
                                                                                                        </ComboBox.ItemContainerStyle>
                                                                                                    </ComboBox>
                                                                                                </StackPanel>
                                                                                            </Border>
                                                                                        </Grid>
                                                                                        <Grid>
                                                                                            <StackPanel VerticalAlignment="Center">
                                                                                                <StackPanel.Style>
                                                                                                    <Style TargetType="StackPanel">
                                                                                                        <Setter Property="Visibility" Value="Hidden"></Setter>
                                                                                                        <Style.Triggers>
                                                                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedSegment.BrushStops.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=1}" Value="True">
                                                                                                                <Setter Property="Visibility" Value="Visible"></Setter>
                                                                                                            </DataTrigger>
                                                                                                        </Style.Triggers>
                                                                                                    </Style>
                                                                                                </StackPanel.Style>
                                                                                                <TextBlock Width="180" TextAlignment="Center" HorizontalAlignment="Center" FontSize="16">
                                                                                                                <Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:" Foreground="#5E5E5E"></Run> 
                                                                                                                <Run FontFamily="{StaticResource digital-7}" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run>
                                                                                                                <Run FontSize="12" Foreground="Gray" Text="{Binding OffsetMeters,Mode=OneWay,StringFormat={}   ( {0:F1}m )}"></Run>
                                                                                                </TextBlock>
                                                                                                <Slider ValueChanged="Offset_Slider_ValueChanged" Style="{StaticResource GradientOffsetSlider}" SmallChange="0.1" IsSnapToTickEnabled="True" TickFrequency="0.1" Margin="0 20 0 0" HorizontalAlignment="Center" Width="300" Value="{Binding OffsetPercent}" IsEnabled="{Binding IsMiddle}" Minimum="0" Maximum="100">
                                                                                                    <Slider.Foreground>
                                                                                                        <SolidColorBrush Color="{Binding Color}"></SolidColorBrush>
                                                                                                    </Slider.Foreground>
                                                                                                    <!--<Slider.Minimum>
                                                                                                        <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="min">
                                                                                                            <Binding Path="."></Binding>
                                                                                                            <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding>
                                                                                                            <Binding Path="StopIndex"></Binding>
                                                                                                        </MultiBinding>
                                                                                                    </Slider.Minimum>
                                                                                                    <Slider.Maximum>
                                                                                                        <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="max">
                                                                                                            <Binding Path="." Delay="500"></Binding>
                                                                                                            <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding>
                                                                                                            <Binding Path="StopIndex"></Binding>
                                                                                                        </MultiBinding>
                                                                                                    </Slider.Maximum>-->
                                                                                                </Slider>
                                                                                            </StackPanel>
                                                                                        </Grid>
                                                                                    </DockPanel>
                                                                                </Grid>
                                                                            </Border>

                                                                            <StackPanel>
                                                                                <Grid VerticalAlignment="Top" Visibility="{Binding ElementName=toggleExpand,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}">
                                                                                    <Grid.Style>
                                                                                        <Style TargetType="Grid">
                                                                                            <Setter Property="LayoutTransform">
                                                                                                <Setter.Value>
                                                                                                    <ScaleTransform ScaleX="1" ScaleY="0" />
                                                                                                </Setter.Value>
                                                                                            </Setter>
                                                                                            <Style.Triggers>
                                                                                                <DataTrigger Binding="{Binding ElementName=toggleExpand, Path=IsChecked}" Value="True">
                                                                                                    <DataTrigger.EnterActions>
                                                                                                        <BeginStoryboard>
                                                                                                            <Storyboard>
                                                                                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.2" />
                                                                                                            </Storyboard>
                                                                                                        </BeginStoryboard>
                                                                                                    </DataTrigger.EnterActions>
                                                                                                    <DataTrigger.ExitActions>
                                                                                                        <BeginStoryboard>
                                                                                                            <Storyboard>
                                                                                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.2" />
                                                                                                            </Storyboard>
                                                                                                        </BeginStoryboard>
                                                                                                    </DataTrigger.ExitActions>
                                                                                                </DataTrigger>
                                                                                            </Style.Triggers>
                                                                                        </Style>
                                                                                    </Grid.Style>
                                                                                    <ContentControl>
                                                                                        <ContentControl.Style>
                                                                                            <Style TargetType="ContentControl">
                                                                                                <Setter Property="Content" Value="{x:Null}"></Setter>
                                                                                                <Style.Triggers>
                                                                                                    <DataTrigger Binding="{Binding ElementName=toggleExpand,Path=IsChecked}" Value="True">
                                                                                                        <Setter Property="Content">
                                                                                                            <Setter.Value>
                                                                                                                <DataGrid AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" Background="Transparent" SelectionUnit="FullRow">
                                                                                                                    <DataGrid.Style>
                                                                                                                        <Style TargetType="DataGrid" BasedOn="{StaticResource {x:Type DataGrid}}">
                                                                                                                            <Setter Property="ItemsSource" Value="{Binding LiquidVolumes}"></Setter>
                                                                                                                            <Style.Triggers>
                                                                                                                                <DataTrigger Binding="{Binding Source={x:Reference control},Path=DataContext.Settings.UsePreferredLiquidVolumeIndex}" Value="True">
                                                                                                                                    <Setter Property="ItemsSource" Value="{Binding LiquidVolumesOrdered}"></Setter>
                                                                                                                                </DataTrigger>
                                                                                                                            </Style.Triggers>
                                                                                                                        </Style>
                                                                                                                    </DataGrid.Style>
                                                                                                                    <DataGrid.CellStyle>
                                                                                                                        <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
                                                                                                                            <Setter Property="BorderThickness" Value="0"/>
                                                                                                                            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                                                                                                                        </Style>
                                                                                                                    </DataGrid.CellStyle>
                                                                                                                    <DataGrid.Columns>
                                                                                                                        <DataGridTemplateColumn Header="IDS PACK">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <Grid x:Name="t0">
                                                                                                                                        <Polygon x:Name="t1" Points="0,0 15,0 0,15 0,0" Margin="-15 -9 0 0">
                                                                                                                                            <Polygon.Fill>
                                                                                                                                                <SolidColorBrush x:Name="t2" Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter},FallbackValue={StaticResource dummyColor}}" />
                                                                                                                                            </Polygon.Fill>
                                                                                                                                        </Polygon>
                                                                                                                                        <TextBlock FontWeight="SemiBold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}"></TextBlock>
                                                                                                                                    </Grid>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="IDX">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <TextBlock Text="{Binding IdsPack.PackIndex,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}" VerticalAlignment="Center" HorizontalAlignment="Center" />
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="D/F">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding NanoliterPerStep,Mode=OneWay,StringFormat='0.00'}"></Run>
                                                                                                                        <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                                    </TextBlock>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="STEP">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <ComboBox ItemsSource="{Binding Source={StaticResource dispenserDivisions}}" SelectedItem="{Binding DispenserStepDivision,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0">
                                                                                                                                        <ComboBox.ItemContainerStyle>
                                                                                                                                            <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
                                                                                                                                                <Setter Property="Background" Value="#ECECEC"></Setter>
                                                                                                                                            </Style>
                                                                                                                                        </ComboBox.ItemContainerStyle>
                                                                                                                                        <ComboBox.ItemTemplate>
                                                                                                                                            <DataTemplate>
                                                                                                                                                <TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
                                                                                                                                            </DataTemplate>
                                                                                                                                        </ComboBox.ItemTemplate>
                                                                                                                                    </ComboBox>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="MAX NL / CM">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding LiquidMaxNanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                                    </TextBlock>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="VOLUME">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding Volume}"></Run>
                                                                                                                        <Run Text="%" Foreground="Gray"></Run>
                                                                                                                                    </TextBlock>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="FORMULA">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding IdsPack.IdsPackFormula.Name}"></Run>
                                                                                                                                    </TextBlock>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="NL / CM">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding NanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                                    </TextBlock>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="NL / SEC">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <TextBlock VerticalAlignment="Center">
                                                                                                                        <Run Text="{Binding NanoliterPerSecond,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                        <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                                    </TextBlock>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                        <DataGridTemplateColumn Header="PULSE / SEC">
                                                                                                                            <DataGridTemplateColumn.CellTemplate>
                                                                                                                                <DataTemplate>
                                                                                                                                    <Label VerticalAlignment="Center">
                                                                                                                                        <Label.Style>
                                                                                                                                            <Style TargetType="Label">
                                                                                                                                                <Setter Property="Content">
                                                                                                                                                    <Setter.Value>
                                                                                                                                                        <TextBlock>
                                                                                                                                                 <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                                                 <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                                                        </TextBlock>
                                                                                                                                                    </Setter.Value>
                                                                                                                                                </Setter>
                                                                                                                                                <Style.Triggers>
                                                                                                                                                    <DataTrigger Binding="{Binding DispenserStepDivision}" Value="{x:Static dispensing:DispenserStepDivisions.Auto}">
                                                                                                                                                        <Setter Property="Content" Value="Auto"></Setter>
                                                                                                                                                    </DataTrigger>
                                                                                                                                                    <DataTrigger Binding="{Binding DispenserStepDivision,Converter={StaticResource IsNotConverter},ConverterParameter={x:Static dispensing:DispenserStepDivisions.Auto}}" Value="True">
                                                                                                                                                        <Setter Property="Content">
                                                                                                                                                            <Setter.Value>
                                                                                                                                                                <TextBlock>
                                                                                                                                                 <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run>
                                                                                                                                                 <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run>
                                                                                                                                                                </TextBlock>
                                                                                                                                                            </Setter.Value>
                                                                                                                                                        </Setter>
                                                                                                                                                    </DataTrigger>
                                                                                                                                                </Style.Triggers>
                                                                                                                                            </Style>
                                                                                                                                        </Label.Style>
                                                                                                                                    </Label>
                                                                                                                                </DataTemplate>
                                                                                                                            </DataGridTemplateColumn.CellTemplate>
                                                                                                                        </DataGridTemplateColumn>
                                                                                                                    </DataGrid.Columns>
                                                                                                                </DataGrid>
                                                                                                            </Setter.Value>
                                                                                                        </Setter>
                                                                                                    </DataTrigger>
                                                                                                </Style.Triggers>
                                                                                            </Style>
                                                                                        </ContentControl.Style>
                                                                                    </ContentControl>
                                                                                </Grid>
                                                                                <ToggleButton Margin="5" x:Name="toggleExpand" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="View more" HorizontalAlignment="Right" Padding="0" Width="24" Height="24" VerticalContentAlignment="Center">
                                                                                    <materialDesign:PackIcon VerticalAlignment="Center">
                                                                                        <materialDesign:PackIcon.Style>
                                                                                            <Style TargetType="materialDesign:PackIcon">
                                                                                                <Setter Property="Kind" Value="ArrowDown"></Setter>
                                                                                                <Setter Property="Margin" Value="0"></Setter>
                                                                                                <Style.Triggers>
                                                                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked}" Value="True">
                                                                                                        <Setter Property="Kind" Value="ArrowUp"></Setter>
                                                                                                    </DataTrigger>
                                                                                                </Style.Triggers>
                                                                                            </Style>
                                                                                        </materialDesign:PackIcon.Style>
                                                                                    </materialDesign:PackIcon>
                                                                                </ToggleButton>
                                                                            </StackPanel>
                                                                        </StackPanel>
                                                                    </DataTemplate>
                                                                </ItemsControl.ItemTemplate>
                                                            </controls:MultiSelectListBox>
                                                        </Grid>
                                                    </DockPanel>
                                                </Grid>
                                            </DockPanel>
                                        </Grid>
                                    </DockPanel>
                                </Grid>
                            </Grid>

                            <Grid Height="80" Grid.Row="1">
                                <DockPanel>
                                    <Grid DockPanel.Dock="Left" VerticalAlignment="Center" Margin="20 15 0 0">
                                        <TextBlock FontSize="16" Margin="0 0 0 0">
                                                        <Run FontWeight="Bold">ESTIMATED DURATION:</Run>
                                                        <Run Foreground="Black" FontSize="22" FontStyle="Italic" FontFamily="{StaticResource digital-7}" Text="{Binding EstimatedDuration,StringFormat=hh\\:mm\\:ss,TargetNullValue='00:00:00'}"></Run>
                                        </TextBlock>
                                    </Grid>

                                    <Grid DockPanel.Dock="Right" Margin="0 0 10 0">
                                        <StackPanel Orientation="Horizontal" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityInverseConverter}}" IsEnabled="{Binding MachineOperator.CanPrint}">
                                            <Button Height="60" Width="280" Command="{Binding StartJobCommand}" Click="OnJobStartClick">
                                                <StackPanel Orientation="Horizontal">
                                                    <materialDesign:PackIcon VerticalAlignment="Center" Width="32" Height="32" Kind="ClockFast" />
                                                    <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="18">START JOB</TextBlock>
                                                </StackPanel>
                                            </Button>
                                            <Button Height="60" Width="60" Margin="-60 0 0 0" Padding="0" Command="{Binding StartJobAndRecordCommand}" Click="OnJobStartClick" ToolTip="Start Job and Record">
                                                <materialDesign:PackIcon VerticalAlignment="Center" Width="38" Height="38" Kind="Record" Foreground="#FF6D6D" />
                                            </Button>
                                        </StackPanel>
                                        <Button Command="{Binding ToRunningJobCommand}" Width="280" Height="60" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}">
                                            <StackPanel Orientation="Horizontal">
                                                <materialDesign:PackIcon VerticalAlignment="Center" Width="32" Height="32" Kind="AlertCircle" />
                                                <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="18">VIEW RUNNING JOB</TextBlock>
                                            </StackPanel>
                                        </Button>
                                    </Grid>

                                    <Grid Margin="0 -18 0 0">
                                        <Border VerticalAlignment="Center" Height="55" Margin="30 0 40 0" ClipToBounds="False">
                                            <Grid ClipToBounds="False">
                                                <ItemsControl x:Name="jobBrushList" ClipToBounds="False" Margin="40 0 50 0">
                                                    <ItemsControl.ItemsPanel>
                                                        <ItemsPanelTemplate>
                                                            <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
                                                        </ItemsPanelTemplate>
                                                    </ItemsControl.ItemsPanel>
                                                    <ItemsControl.ItemTemplate>
                                                        <DataTemplate>
                                                            <Grid>
                                                                <Grid.Width>
                                                                    <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
                                                                        <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob.Length"></Binding>
                                                                        <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
                                                                        <Binding Path="Length"></Binding>
                                                                    </MultiBinding>
                                                                </Grid.Width>
                                                                <Rectangle VerticalAlignment="Bottom" Height="20">
                                                                    <Rectangle.Fill>
                                                                        <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
                                                                            <Binding Path="."></Binding>
                                                                            <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob"></Binding>
                                                                            <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob.Length"></Binding>
                                                                            <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding>
                                                                        </MultiBinding>
                                                                    </Rectangle.Fill>
                                                                </Rectangle>

                                                                <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center">
                                                                    <TextBlock FontSize="12" HorizontalAlignment="Right" Foreground="Black">
                                                                                <Run Text="{Binding Length,Mode=OneWay,StringFormat=N2}"></Run>
                                                                                <Run Foreground="Gray" FontSize="10" Text="m"></Run>
                                                                    </TextBlock>
                                                                    <materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="8" Height="8" Foreground="DimGray">
                                                                        <materialDesign:PackIcon.RenderTransform>
                                                                            <RotateTransform Angle="180" />
                                                                        </materialDesign:PackIcon.RenderTransform>
                                                                    </materialDesign:PackIcon>
                                                                </StackPanel>
                                                            </Grid>
                                                        </DataTemplate>
                                                    </ItemsControl.ItemTemplate>
                                                </ItemsControl>

                                                <StackPanel Margin="-30 -5 0 0" HorizontalAlignment="Left">
                                                    <TextBlock FontSize="12" Foreground="Black">
                                                                                <Run Text="0"></Run>
                                                                                <Run Foreground="Gray" FontSize="10" Text="m"></Run>
                                                    </TextBlock>
                                                    <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="16" Height="16" Foreground="DimGray">

                                                    </materialDesign:PackIcon>
                                                </StackPanel>

                                                <StackPanel Margin="0 -5 -20 0" HorizontalAlignment="Right">
                                                    <TextBlock FontSize="12" Foreground="Black">
                                                                                <Run Text="{Binding ActiveJob.Length,Mode=OneWay,StringFormat=N2}"></Run>
                                                                                <Run Foreground="Gray" FontSize="10" Text="m"></Run>
                                                        <Run>x</Run>
                                                        <Run Text="{Binding ActiveJob.NumberOfUnits}"></Run>
                                                    </TextBlock>
                                                    <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16" Foreground="DimGray">

                                                    </materialDesign:PackIcon>
                                                </StackPanel>

                                                <Border BorderBrush="Gainsboro" BorderThickness="1" VerticalAlignment="Bottom" Height="20" Margin="40 0 50 0">

                                                </Border>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </DockPanel>
                            </Grid>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>

            <Grid>
                <Grid Background="#B9FFFFFF">
                    <Grid.Style>
                        <Style TargetType="Grid">
                            <Setter Property="Width" Value="520"></Setter>
                            <Setter Property="LayoutTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True">
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Style>
                    <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Background="Transparent">
                        <StackPanel>
                            <Expander Header="PROCESS PARAMETERS" IsExpanded="True" Background="Transparent">
                                <Grid>
                                    <Grid>
                                        <StackPanel Orientation="Vertical" Margin="5">

                                            <Border  MaxHeight="200" Margin="5">
                                                <DockPanel>
                                                    <ComboBox Margin="0 10 0 0" ItemsSource="{Binding GroupsHistory}" SelectedItem="{Binding SelectedGroupHistory}">
                                                        <ComboBox.ItemContainerStyle>
                                                            <Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
                                                                <Setter Property="Background" Value="#E6FFFFFF"></Setter>
                                                                <Setter Property="Padding" Value="5"></Setter>
                                                            </Style>
                                                        </ComboBox.ItemContainerStyle>
                                                        <ComboBox.ItemTemplate>
                                                            <DataTemplate>
                                                                <StackPanel Orientation="Horizontal" Margin="0 10">
                                                                    <TextBlock Text="{Binding Name}" FontWeight="Bold" VerticalAlignment="Center">
                                                                        <TextBlock.Style>
                                                                            <Style TargetType="TextBlock">
                                                                                <Style.Triggers>
                                                                                    <DataTrigger Binding="{Binding Active}" Value="True">
                                                                                        <Setter Property="Foreground" Value="#FF5F5F"></Setter>
                                                                                        <Setter Property="FontStyle" Value="Italic"></Setter>
                                                                                    </DataTrigger>
                                                                                </Style.Triggers>
                                                                            </Style>
                                                                        </TextBlock.Style>
                                                                    </TextBlock>
                                                                    <TextBlock Text="{Binding SaveDate}" Margin="10 0 0 0" FontStyle="Italic" Foreground="Gray" VerticalAlignment="Center"></TextBlock>
                                                                </StackPanel>
                                                            </DataTemplate>
                                                        </ComboBox.ItemTemplate>
                                                    </ComboBox>

                                                </DockPanel>
                                            </Border>
                                            <ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" Style="{x:Null}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding RmlProcessParametersTableGroup.ProcessParametersTables}" SelectedItem="{Binding SelectedProcessParametersTable}" IsEnabled="{Binding RmlProcessParametersTableGroup.Active}">
                                                <ListBox.ItemContainerStyle>
                                                    <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">

                                                    </Style>
                                                </ListBox.ItemContainerStyle>
                                                <!--<ListBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel IsItemsHost="True"></WrapPanel>
                                            </ItemsPanelTemplate>
                                        </ListBox.ItemsPanel>-->
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate DataType="{x:Type observables:ProcessParametersTable}">
                                                        <Border Padding="5" CornerRadius="5" BorderThickness="1" Margin="5">
                                                            <Border.Style>
                                                                <Style TargetType="Border">
                                                                    <Setter Property="BorderBrush" Value="Silver"></Setter>
                                                                    <Setter Property="Opacity" Value="0.5"></Setter>
                                                                    <Setter Property="Background" Value="Transparent"></Setter>
                                                                    <Style.Triggers>
                                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True">
                                                                            <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter>
                                                                            <Setter Property="Background" Value="#D4FFFFFF"></Setter>
                                                                            <Setter Property="Opacity" Value="1"></Setter>
                                                                        </DataTrigger>
                                                                    </Style.Triggers>
                                                                </Style>
                                                            </Border.Style>
                                                            <Grid>
                                                                <StackPanel>
                                                                    <DockPanel>
                                                                        <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox>
                                                                        <WrapPanel Orientation="Vertical" Margin="0 5 0 0">
                                                                            <WrapPanel.Resources>
                                                                                <Style TargetType="TextBlock">
                                                                                    <Setter Property="FontSize" Value="10"></Setter>
                                                                                    <Setter Property="Foreground" Value="#7A7A7A"></Setter>
                                                                                    <Setter Property="Margin" Value="0 5 0 5"></Setter>
                                                                                    <Setter Property="MinWidth" Value="80"></Setter>
                                                                                </Style>

                                                                                <Style TargetType="mahapps:NumericUpDown">
                                                                                    <Setter Property="FontFamily" Value="{StaticResource digital-7}"></Setter>
                                                                                </Style>

                                                                                <Style TargetType="ContentControl">
                                                                                    <!--<Setter Property="FontFamily" Value="digital-7"></Setter>-->
                                                                                    <Setter Property="Template">
                                                                                        <Setter.Value>
                                                                                            <ControlTemplate TargetType="ContentControl">
                                                                                                <Grid Width="97">
                                                                                                    <Border>
                                                                                                        <Border.Style>
                                                                                                            <Style TargetType="Border">
                                                                                                                <Setter Property="BorderBrush" Value="Gainsboro"></Setter>
                                                                                                                <Setter Property="BorderThickness" Value="1"></Setter>
                                                                                                                <Setter Property="Padding" Value="2"></Setter>
                                                                                                                <Setter Property="Margin" Value="4"></Setter>
                                                                                                                <Setter Property="CornerRadius" Value="3"></Setter>
                                                                                                            </Style>
                                                                                                        </Border.Style>
                                                                                                        <ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter>
                                                                                                    </Border>

                                                                                                    <materialDesign:PackIcon HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 0 0 0" Width="12" Height="12" Kind="Settings"></materialDesign:PackIcon>
                                                                                                </Grid>
                                                                                            </ControlTemplate>
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Style>


                                                                            </WrapPanel.Resources>
                                                                            <editors:ParameterizedEditor ParameterizedObject="{Binding}" GeneratingItems="ParameterizedEditor_GeneratingItems">
                                                                                <editors:ParameterizedEditor.ItemsPanel>
                                                                                    <ItemsPanelTemplate>
                                                                                        <WrapPanel IsItemsHost="True" Orientation="Horizontal" />
                                                                                    </ItemsPanelTemplate>
                                                                                </editors:ParameterizedEditor.ItemsPanel>
                                                                                <editors:ParameterizedEditor.DoubleTemplate>
                                                                                    <DataTemplate>
                                                                                        <Grid Background="Transparent" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessParameterDropped" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=editors:ParameterizedEditor},Path=DraggingSurface}">
                                                                                            <ContentControl>
                                                                                                <StackPanel>
                                                                                                    <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11"></TextBlock>
                                                                                                    <mahapps:NumericUpDown FontSize="20" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Center" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown>
                                                                                                </StackPanel>
                                                                                            </ContentControl>
                                                                                        </Grid>
                                                                                    </DataTemplate>
                                                                                </editors:ParameterizedEditor.DoubleTemplate>
                                                                            </editors:ParameterizedEditor>
                                                                        </WrapPanel>
                                                                    </DockPanel>

                                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}">
                                                                        <TextBlock Text="Active" FontWeight="Bold" FontStyle="Italic" FontSize="13" VerticalAlignment="Center"></TextBlock>
                                                                        <materialDesign:PackIcon Foreground="#90E990" Kind="CheckboxBlankCircle" VerticalAlignment="Center" Margin="5 0 0 0">
                                                                            <materialDesign:PackIcon.Style>
                                                                                <Style TargetType="materialDesign:PackIcon">
                                                                                    <Setter Property="Opacity" Value="0"></Setter>
                                                                                    <Style.Triggers>
                                                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True">
                                                                                            <DataTrigger.EnterActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever">
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="0" />
                                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </DataTrigger.EnterActions>
                                                                                            <DataTrigger.ExitActions>
                                                                                                <BeginStoryboard>
                                                                                                    <Storyboard>
                                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01">
                                                                                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                                    </Storyboard>
                                                                                                </BeginStoryboard>
                                                                                            </DataTrigger.ExitActions>
                                                                                        </DataTrigger>
                                                                                    </Style.Triggers>
                                                                                </Style>
                                                                            </materialDesign:PackIcon.Style>
                                                                        </materialDesign:PackIcon>
                                                                    </StackPanel>
                                                                </StackPanel>
                                                            </Grid>
                                                        </Border>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>

                                            <StackPanel Margin="10 20" VerticalAlignment="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
                                                <Button Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="#202020" Foreground="#202020" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device">
                                                    <TextBlock TextWrapping="Wrap" TextAlignment="Center">
                                                        TEMP OFF
                                                    </TextBlock>
                                                </Button>
                                                <Button Height="40" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}">
                                                    <StackPanel Orientation="Horizontal">
                                                        <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentSave"></materialDesign:PackIcon>
                                                        <TextBlock Margin="10 0 0 0">SAVE PARAMETERS</TextBlock>
                                                    </StackPanel>
                                                </Button>
                                                <Button Height="40" Margin="10 0 0 0" Command="{Binding PushProcessParametersCommand}" HorizontalAlignment="Left">
                                                    <StackPanel Orientation="Horizontal">
                                                        <materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowRightBold"></materialDesign:PackIcon>
                                                        <TextBlock Margin="10 0 0 0">PUSH PARAMETERS</TextBlock>
                                                    </StackPanel>
                                                </Button>
                                            </StackPanel>
                                        </StackPanel>
                                    </Grid>

                                    <Grid Background="White">
                                        <Grid.Style>
                                            <Style TargetType="Grid">
                                                <Setter Property="Visibility" Value="Visible"></Setter>
                                                <Style.Triggers>
                                                    <MultiDataTrigger>
                                                        <MultiDataTrigger.Conditions>
                                                            <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition>
                                                            <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition>
                                                        </MultiDataTrigger.Conditions>
                                                        <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                    </MultiDataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Grid.Style>
                                        <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE &amp; MEDIA</TextBlock>
                                    </Grid>
                                </Grid>
                            </Expander>
                            <!--<Expander Header="CONTROL PARAMETERS" IsExpanded="False" Background="#8EFFFFFF">

                            </Expander>-->
                        </StackPanel>
                    </ScrollViewer>

                    <Rectangle HorizontalAlignment="Right" Stroke="#383838" VerticalAlignment="Top" Height="427"></Rectangle>
                    <Rectangle HorizontalAlignment="Right" Stroke="#383838" VerticalAlignment="Bottom" Height="428"></Rectangle>
                </Grid>

                <Button Background="Transparent" Command="{Binding ToggleSideBarCommand}" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Center" Height="200" Width="50" Margin="0 0 -50 0">
                    <Border Background="#F1F1F1" CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="#383838">
                        <Grid>
                            <TextBlock Foreground="#FF7272" Text="PROCESS PARAMETERS" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <TextBlock.LayoutTransform>
                                    <RotateTransform Angle="270"></RotateTransform>
                                </TextBlock.LayoutTransform>
                            </TextBlock>
                        </Grid>
                    </Border>
                </Button>
            </Grid>

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