blob: a0021d40e4cceb608b4ef513d07c31ac5187c140 (
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
|
<UserControl x:Class="Tango.PPC.Technician.Views.SynchronizationView"
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.Technician.Views"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:vm="clr-namespace:Tango.PPC.Technician.ViewModels"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:converters="clr-namespace:Tango.PPC.Technician.Converters"
xmlns:global="clr-namespace:Tango.PPC.Technician"
mc:Ignorable="d"
d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:SynchronizationViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.SynchronizationViewVM}">
<UserControl.Resources>
<converters:LogItemMessageToOneLineConverter x:Key="LogItemMessageToOneLineConverter" />
</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">Synchronization</TextBlock>
</Border>
<Grid Grid.Row="1">
<DockPanel>
<DockPanel DockPanel.Dock="Bottom">
<DockPanel Margin="20 0 20 20">
<touch:TouchButton IsEnabled="{Binding MachineDataSynchronizer.IsEnabled}" DockPanel.Dock="Right" Padding="50 20" CornerRadius="30" Command="{Binding SynchronizeCommand}">Synchronize Now</touch:TouchButton>
<TextBlock Foreground="{StaticResource TangoGrayTextBrush}" VerticalAlignment="Center" TextWrapping="Wrap" Margin="0 0 20 0">Synchronization occurres automatically in the background. You can choose to synchronize now.</TextBlock>
</DockPanel>
</DockPanel>
<Grid Margin="20">
<touch:TouchSimpleDataGrid Background="{StaticResource TangoPrimaryBackgroundBrush}" AutoGenerateColumns="False" SelectionMode="Single" SelectionUnit="FullRow" BorderThickness="1" BorderBrush="{StaticResource TangoDarkForegroundBrush}" HeadersVisibility="Column" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserSortColumns="False" IsReadOnly="True" ItemsSource="{Binding MachineDataSynchronizer.StatusHistory}" SelectedItem="{Binding SelectedStatus}" VerticalGridLinesBrush="{x:Null}" HorizontalGridLinesBrush="{StaticResource TangoGrayBrush}" RowHeight="50" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled">
<DataGrid.Resources>
<Style BasedOn="{StaticResource {x:Type DataGridColumnHeader}}" TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Background" Value="{StaticResource TangoDarkForegroundBrush}" />
<Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}" />
<Setter Property="Padding" Value="5"></Setter>
</Style>
</DataGrid.Resources>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Header="" Width="50">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<touch:TouchIcon Width="16">
<touch:TouchIcon.Style>
<Style TargetType="touch:TouchIcon">
<Setter Property="Icon" Value="Pause"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding State}" Value="Pending">
<Setter Property="Icon" Value="Pause"></Setter>
<Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding State}" Value="Synchronizing">
<Setter Property="Icon" Value="CloudSync"></Setter>
<Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding State}" Value="Failed">
<Setter Property="Icon" Value="Alert"></Setter>
<Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding State}" Value="Completed">
<Setter Property="Icon" Value="Check"></Setter>
<Setter Property="Foreground" Value="{StaticResource TangoGreenBrush}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</touch:TouchIcon.Style>
</touch:TouchIcon>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="Start Time" Width="120" Binding="{Binding StartDateTime,StringFormat=t}" />
<DataGridTextColumn Header="Status" Width="120" Binding="{Binding State,Converter={StaticResource EnumToDescriptionConverter}}" />
<DataGridTextColumn Header="Duration" Width="120" Binding="{Binding Duration,StringFormat='hh\\:mm\\:ss'}" />
<DataGridTemplateColumn Header="Message" Width="1*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Message,Converter={StaticResource StringEllipsisConverter},ConverterParameter='70',Mode=OneWay}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</touch:TouchSimpleDataGrid>
</Grid>
</DockPanel>
</Grid>
</Grid>
</UserControl>
|