aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
blob: b57619c8c902eba27299ef602dcb33d3f1d81956 (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
<UserControl x:Class="Tango.PPC.Jobs.Views.JobsView"
             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:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Tango.PPC.Jobs.Views"
             xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
			 xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
             xmlns:converters="clr-namespace:Tango.PPC.Jobs.Converters"
             xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:touchComponents="clr-namespace:Tango.Touch.Components;assembly=Tango.Touch"
             xmlns:fa="http://schemas.fontawesome.io/icons/"
			 xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL"
             xmlns:views="clr-namespace:Tango.PPC.Jobs.Views"
             xmlns:vm="clr-namespace:Tango.PPC.Jobs.ViewModels"
             xmlns:global="clr-namespace:Tango.PPC.Jobs"
             mc:Ignorable="d" 
             d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:JobsViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.JobsViewVM}">

    <UserControl.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Styles.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <converters:JobToPieImageConverter x:Key="JobToPieImageConverter" />
            <converters:LengthWithSpoolsConverter x:Key="LengthWithSpoolsConverter"/>
            <sharedConverters:DateTimeUTCToShortDateConverter x:Key="DateTimeUTCToShortDateConverter" />
            <sharedConverters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
            <sharedConverters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
            <converters:JobsCategoryToVisibilityConverter x:Key="JobsCategoryToVisibilityConverter" />
            <converters:JobsCategoryToOpacityConverter x:Key="JobsCategoryToOpacityConverter" />

            <BitmapImage x:Key="SelectAll" UriSource="../Images/JobView/select_all.png" />
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid Background="{StaticResource TangoMidBackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>

        <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}">
            <Border.Effect>
                <DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" />
            </Border.Effect>
            <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Jobs</TextBlock>
        </Border>

        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="100"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>

            <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -28 30 0">
                <StackPanel Orientation="Horizontal" Height="58" RenderTransformOrigin="0.5,0.5">
                    <StackPanel.Style>
                        <Style TargetType="StackPanel">
                            <Setter Property="Opacity" Value="0"></Setter>
                            <Setter Property="IsHitTestVisible" Value="False"></Setter>
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <TranslateTransform X="100" />
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsMultiSelecting}" Value="True">
                                    <Setter Property="IsHitTestVisible" Value="True"></Setter>
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.X" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.X" To="100" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </StackPanel.Style>
                    <touch:TouchIconButton Command="{Binding ClearSelectionCommand}" Visibility="{Binding IsMultiSelecting,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 0 30 0" Padding="20" Icon="Close" Width="50" Height="50" Style="{StaticResource TangoRoundTouchIconButton}">
                       
                    </touch:TouchIconButton>
                    <!--<touch:TouchIconButton Command="{Binding SelectAllJobsCommand}" Margin="0 0 30 0" Padding="20" Icon="CheckboxMultipleMarkedOutline" Style="{StaticResource TangoRoundTouchIconButton}">>-->
                    <touch:TouchButton x:Name="SelectAllButton"  Command="{Binding SelectAllJobsCommand}" Margin="0 0 30 0" EnableDropShadow="False">
                        <touch:TouchButton.Style>
                            <Style TargetType="touch:TouchButton" >
                                <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter>
                                <Setter Property="RenderOptions.EdgeMode" Value="Unspecified"></Setter>
                                <Setter Property="RenderOptions.BitmapScalingMode" Value="Fant"></Setter>
                                <Setter Property="CornerRadius" Value="50"></Setter>
                                <Setter Property="RippleCentered" Value="True"></Setter>
                                <Setter Property="RippleFactor" Value="2"></Setter>
                                <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter>
                            </Style>
                        </touch:TouchButton.Style>
                        <Image Source="{StaticResource SelectAll}" Width="24" Height="24"></Image>
                    </touch:TouchButton>
                    <!--</touch:TouchIconButton>-->
                    <touch:TouchIconButton Command="{Binding MoveToListJobsCommand}" Margin="0 0 30 0" Padding="20"  >
                        <touch:TouchIconButton.Style>
                            <Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource TangoRoundTouchIconButton}">
                                <Setter Property="IconAngle" Value="0"></Setter>
                                <Setter Property="Icon" Value="Redo"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding SelectedCategoryIndex}" Value="1">
                                        <Setter Property="Icon" Value="Undo"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </touch:TouchIconButton.Style>
                    </touch:TouchIconButton>
                    <touch:TouchIconButton Command="{Binding ExportJobCommand}" Margin="0 0 30 0" Padding="20" Icon="HddRegular" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton>
                    <touch:TouchIconButton Command="{Binding CloneJobsCommand}" Margin="0 0 30 0" Padding="20" Icon="CopyRegular" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton>
                    <touch:TouchIconButton Command="{Binding DeleteJobsCommand}" Padding="20" Icon="TrashAltRegular" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton>
                </StackPanel>
                <touch:TouchIconButton Command="{Binding AddJobCommand}" RenderTransformOrigin="0.5,0.5" Margin="0 -15 0 0" Padding="20" Height="80" Icon="Plus" HorizontalAlignment="Right"  Visibility="{Binding BuildProvider.IsEureka, Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                    <touch:TouchIconButton.Style>
                        <Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource TangoRoundTouchIconButton}">
                            <Setter Property="Opacity" Value="1"></Setter>
                            <Setter Property="IsHitTestVisible" Value="True"></Setter>
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsMultiSelecting}" Value="True">
                                    <Setter Property="IsHitTestVisible" Value="False"></Setter>
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0.5" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0.5" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </touch:TouchIconButton.Style>
                </touch:TouchIconButton>
            </Grid>

            <DockPanel>
                <touch:TouchNavigationLinks DockPanel.Dock="Left" x:Name="navigationLinks" SelectionChanged="TouchNavigationLinks_SelectionChanged" SelectedIndex="{Binding SelectedCategoryIndex,Mode=TwoWay}" IsEnabled="{Binding IsMultiSelecting,Converter={StaticResource BooleanInverseConverter}}" VerticalAlignment="Bottom" Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}">
                    <TextBlock>DRAFT</TextBlock>
                    <TextBlock>HISTORY</TextBlock>
                </touch:TouchNavigationLinks>

                <Grid VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0 5 0 0">
                    <DockPanel>
                        <Rectangle Margin="0 0 20 0" HorizontalAlignment="Center" VerticalAlignment="Bottom" Stroke="{StaticResource TangoGrayBrush}" StrokeThickness="1" Height="25"></Rectangle>
                        <touch:TouchIcon DockPanel.Dock="Left" Foreground="{StaticResource TangoGrayBrush}" Width="20" Height="20" VerticalAlignment="Bottom" Icon="Magnify" />
                        <touch:TouchTextBox Margin="5 0 0 0" Width="300" Text="{Binding Filter,Mode=TwoWay}" Watermark="find name"></touch:TouchTextBox>
                    </DockPanel>
                </Grid>
                <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="0 20 20 0"  Visibility="{Binding BuildProvider.IsEureka, Converter={StaticResource BooleanToVisibilityConverter}}">
                    <!--<TextBlock  FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 10 0 0">ADD JOB</TextBlock>-->
                    <touch:TouchIconButton Command="{Binding AddJobCommand}" RenderTransformOrigin="0.5,0.5" Margin="20 0 10 0" Padding="20" Height="70" Icon="Plus" HorizontalAlignment="Right" Background="{StaticResource TangoPrimaryAccentBrush}">
                    <touch:TouchIconButton.Style>
                        <Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource TangoRoundTouchIconButton}">
                            <Setter Property="Opacity" Value="1"></Setter>
                            <Setter Property="IsHitTestVisible" Value="True"></Setter>
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsMultiSelecting}" Value="True">
                                    <Setter Property="IsHitTestVisible" Value="False"></Setter>
                                    <DataTrigger.EnterActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0.5" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0.5" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.EnterActions>
                                    <DataTrigger.ExitActions>
                                        <BeginStoryboard>
                                            <Storyboard>
                                                <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                                <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </DataTrigger.ExitActions>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </touch:TouchIconButton.Style>
                </touch:TouchIconButton>
                </StackPanel>
            </DockPanel>

            <Grid Grid.Row="1" x:Name="moveGrid">
                <touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='Draft'}">
                    <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" RenderOptions.EdgeMode="Unspecified" Style="{StaticResource TangoJobsGrid}" x:Name="dataGridJobs" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" OnDragAndDropCommand="{Binding JobDragedDroppedCommand}" ItemsSource="{Binding DraftJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10" SelectAll="{Binding SelectAll,Mode=TwoWay}">
                        <touch:LightTouchDataGrid.Columns>
                            <!--<touch:LightTouchDataGridColumn Width="90">
                                <touch:LightTouchDataGridColumn.Header>
                                    <Image Source="../Images/warning.png" Width="24" />
                                </touch:LightTouchDataGridColumn.Header>
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <Grid Margin="5 0 0 0" Width="40" Height="40">
                                            <Image HorizontalAlignment="Left" VerticalAlignment="Top" Width="20">
                                                <Image.Style>
                                                    <Style TargetType="Image">
                                                        <Setter Property="Source" Value="../Images/sample_approved_small_gray.png"></Setter>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding JobSampleDyeStatus}" Value="Approved">
                                                                <Setter Property="Source" Value="../Images/sample_approved_small.png"></Setter>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Image.Style>
                                            </Image>
                                            <Image HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="20">
                                                <Image.Style>
                                                    <Style TargetType="Image">
                                                        <Setter Property="Source" Value="../Images/color_approved_small_gray.png"></Setter>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding JobFineTuningStatus}" Value="Approved">
                                                                <Setter Property="Source" Value="../Images/color_approved_small.png"></Setter>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Image.Style>
                                            </Image>
                                        </Grid>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>-->
                            <touch:LightTouchDataGridColumn Width="1*"  SortMember="Name" HorizontalContentAlignment="Left">
                                <touch:LightTouchDataGridColumn.Header>
                                    <TextBlock Margin="20 0 0 0" Text="Name"  />
                                </touch:LightTouchDataGridColumn.Header>
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Margin="20 0 0 0" IsHitTestVisible="False" Text="{Binding Name,Converter={StaticResource StringEllipsisConverter},ConverterParameter='56'}" TextWrapping="Wrap"></TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn> 
                            <touch:LightTouchDataGridColumn Width="200" Header="Thread" SortMember="ThreadName" HorizontalContentAlignment="Left">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Margin="5 0 0 0" IsHitTestVisible="False" Text="{Binding ThreadName,Converter={StaticResource StringEllipsisConverter},ConverterParameter='44'}" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Regular"></TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="LengthIncludingNumberOfUnits">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock IsHitTestVisible="False">
                                            <TextBlock.Text>
                                                <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="#,0.0" TargetNullValue='0' FallbackValue='0' Mode="OneWay">
                                                    <Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/>
                                                    <Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
                                                    <Binding Path="Spools" Mode="OneWay"/>
                                                </MultiBinding>
                                            </TextBlock.Text>
                                        </TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                           
                            <touch:LightTouchDataGridColumn Header="Colors" SortMember="Segments.Count" Width="85">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <Image Stretch="Fill" IsHitTestVisible="False" Source="{Binding Converter={StaticResource JobToPieImageConverter},ConverterParameter='60,60',IsAsync=True}" Width="60" Height="60" HorizontalAlignment="Left"></Image>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn Width="100" Header="Updated" SortMember="LastUpdated">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock IsHitTestVisible="False" Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}" FontWeight="Regular"></TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn SortMember="JobIndex" SortDirection="{x:Null}" Width="78" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" DisplayChevron="False" ForcedSortDirection="Ascending">
                                <touch:LightTouchDataGridColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <Border CornerRadius="0 5 5 0">
                                            <Border.Style>
                                                <Style TargetType="Border">
                                                    <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding SortDirection}" Value="Ascending">
                                                            <Setter Property="Background" Value="{StaticResource TangoLowAccentBrush}"></Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Border.Style>
                                            <Grid>
                                                <Rectangle HorizontalAlignment="Left" StrokeThickness="2" Stroke="{StaticResource TangoColumnDividerBrush}" />
                                                <Image Source="/Images/arrows.png" Width="28" />
                                            </Grid>
                                        </Border>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.HeaderTemplate>
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <dragAndDrop:DragThumb IsEnabled="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.IsMultiSelecting,Converter={StaticResource BooleanInverseConverter}}" Background="Transparent" touchComponents:Ripple.PreventRipple="True" touchComponents:TransformationHelper.PreventTransform="True">
                                            <dragAndDrop:DragThumb.Style>
                                                <Style TargetType="dragAndDrop:DragThumb">
                                                    <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=touch:LightTouchDataGridCell},Path=Column.SortDirection}" Value="Ascending">
                                                            <Setter Property="Visibility" Value="Visible"></Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </dragAndDrop:DragThumb.Style>
                                            <StackPanel Width="30" IsHitTestVisible="False" VerticalAlignment="Center">
                                                <Rectangle StrokeThickness="2" Stroke="{StaticResource TangoDarkForegroundBrush}" />
                                                <Rectangle StrokeThickness="2" Stroke="{StaticResource TangoDarkForegroundBrush}" Margin="0 5 0 0" />
                                            </StackPanel>
                                        </dragAndDrop:DragThumb>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                        </touch:LightTouchDataGrid.Columns>
                    </touch:LightTouchDataGrid>
                </touch:TouchLoadingPanel>

                <touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='History'}">
                    <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" EnableDragAndDrop="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10" SelectAll="{Binding SelectAll,Mode=TwoWay}">
                        <touch:LightTouchDataGrid.Columns>
                            <touch:LightTouchDataGridColumn Width="50">
                                <touch:LightTouchDataGridColumn.Header>
                                    <Image Source="../Images/warning.png" Width="24" />
                                </touch:LightTouchDataGridColumn.Header>
                                <touch:LightTouchDataGridColumn.CellTemplate >
                                    <DataTemplate>
                                        <touch:TouchIcon Width="26" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" >
                                            <touch:TouchIcon.Style>
                                                <Style TargetType="touch:TouchIcon">
                                                    <Setter Property="Icon" Value="Check"></Setter>
                                                    <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter>
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding JobStatus}" Value="Disrupted">
                                                            <Setter Property="Icon" Value="AlertCircleOutline"></Setter>
                                                            <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </touch:TouchIcon.Style>
                                        </touch:TouchIcon>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn Width="100" Header="Status" SortMember="JobStatus" HorizontalContentAlignment="Left">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock IsHitTestVisible="False" Text="{Binding JobStatus,Converter={StaticResource EnumToDescriptionConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Regular"></TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn Width="1*" Header="Name" SortMember="Name" HorizontalContentAlignment="Left">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock  IsHitTestVisible="False" Text="{Binding Name,Converter={StaticResource StringEllipsisConverter},ConverterParameter='46'}" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn Width="200" Header="Thread" SortMember="ThreadName" HorizontalContentAlignment="Left">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Margin="5 0 0 0"  IsHitTestVisible="False" Text="{Binding ThreadName,Converter={StaticResource StringEllipsisConverter},ConverterParameter='43'}" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Regular"></TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="LengthIncludingNumberOfUnits">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock IsHitTestVisible="False" >
                                            <TextBlock.Text>
                                                <MultiBinding Converter="{StaticResource LengthWithSpoolsConverter}" StringFormat="0.0" TargetNullValue='0' FallbackValue='0'>
                                                    <Binding Path="LengthIncludingNumberOfUnits" Mode="OneWay"/>
                                                    <Binding Path="DataContext.BuildProvider.IsEureka" Mode="OneWay" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
                                                    <Binding Path="Spools" Mode="OneWay"/>
                                                </MultiBinding>
                                            </TextBlock.Text>
                                        </TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn Header="Colors" SortMember="Segments.Count" Width="85">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <Image Stretch="Fill" IsHitTestVisible="False" Source="{Binding Converter={StaticResource JobToPieImageConverter},ConverterParameter='60,60',IsAsync=True}" Width="60" Height="60" HorizontalAlignment="Left"></Image>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn Width="100" Header="Updated" SortMember="LastUpdated">
                                <touch:LightTouchDataGridColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock IsHitTestVisible="False" Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}" FontWeight="Regular"></TextBlock>
                                    </DataTemplate>
                                </touch:LightTouchDataGridColumn.CellTemplate>
                            </touch:LightTouchDataGridColumn>
                        </touch:LightTouchDataGrid.Columns>
                    </touch:LightTouchDataGrid>
                </touch:TouchLoadingPanel>
            </Grid>
        </Grid>
    </Grid>
</UserControl>