aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml
blob: 56c444fb78f3ea3243875c96d56cc919d8b1ab94 (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
<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: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: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>
        <converters:JobToPieImageConverter x:Key="JobToPieImageConverter" />
        <sharedConverters:DateTimeUTCToShortDateConverter x:Key="DateTimeUTCToShortDateConverter" />
        <sharedConverters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
        
    </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>

            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Height="57" Margin="0 -28 30 0">
                <touch:TouchIconButton Margin="0 0 30 0" Padding="20" Icon="Plus" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton>
                <touch:TouchIconButton Margin="0 0 30 0" Padding="20" Icon="Copy" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton>
                <touch:TouchIconButton Padding="20" Icon="Refresh" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton>
            </StackPanel>

            <touch:TouchNavigationLinks VerticalAlignment="Bottom" Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}">
                <sys:String>READY TO DYE</sys:String>
                <sys:String>NOT READY</sys:String>
                <sys:String>ALL</sys:String>
            </touch:TouchNavigationLinks>

            <Grid Grid.Row="1">
                <touch:LightTouchDataGrid x:Name="dataGridJobs" OnDragAndDropCommand="{Binding OnDragAndDropCommand}" ItemsSource="{Binding JobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10">
                    <touch:LightTouchDataGrid.Columns>
                        <touch:LightTouchDataGridColumn>
                            <touch:LightTouchDataGridColumn.Header>
                                <Image Source="../Images/warning.png" Width="24" />
                            </touch:LightTouchDataGridColumn.Header>
                            <touch:LightTouchDataGridColumn.CellTemplate>
                                <DataTemplate>
                                    <Image Source="../Images/Job Issues/cyan.png" Width="38" />
                                </DataTemplate>
                            </touch:LightTouchDataGridColumn.CellTemplate>
                        </touch:LightTouchDataGridColumn>
                        <touch:LightTouchDataGridColumn Width="90" Header="Status" SortMember="JobStatus">
                            <touch:LightTouchDataGridColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock IsHitTestVisible="False" Text="{Binding JobStatus,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
                                </DataTemplate>
                            </touch:LightTouchDataGridColumn.CellTemplate>
                        </touch:LightTouchDataGridColumn>
                        <touch:LightTouchDataGridColumn Width="240" Header="Name" SortMember="Name">
                            <touch:LightTouchDataGridColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock IsHitTestVisible="False" Text="{Binding Name}"></TextBlock>
                                </DataTemplate>
                            </touch:LightTouchDataGridColumn.CellTemplate>
                        </touch:LightTouchDataGridColumn>
                        <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="Length">
                            <touch:LightTouchDataGridColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock IsHitTestVisible="False" Text="{Binding Length,StringFormat=0.0}"></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='25,25'}" Width="25" Height="25" 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}}"></TextBlock>
                                </DataTemplate>
                            </touch:LightTouchDataGridColumn.CellTemplate>
                        </touch:LightTouchDataGridColumn>
                        <touch:LightTouchDataGridColumn x:Name="userSortColumn" 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" x:Name="userSortColumnBorder">
                                        <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 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 Source={x:Reference userSortColumn},Path=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>

                <TextBox VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="100" Width="200" keyboard:KeyboardView.Mode="Alpha"></TextBox>
            </Grid>
        </Grid>
    </Grid>
</UserControl>