blob: 65a5a569f1fbf30d336785b2de46ca17bcc6c76a (
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
|
<UserControl x:Class="Tango.MachineStudio.MachineDesigner.Views.MachineUpdatesView"
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:vm="clr-namespace:Tango.MachineStudio.MachineDesigner.ViewModels"
xmlns:global="clr-namespace:Tango.MachineStudio.MachineDesigner"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views"
mc:Ignorable="d"
d:DesignHeight="720" d:DesignWidth="1280" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<UserControl.Resources>
<converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
<converters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter" />
<converters:StringToOneLineConverter x:Key="StringToOneLineConverter" />
</UserControl.Resources>
<Grid Margin="20" DataContext="{Binding MachineUpdatesViewVM}">
<DockPanel IsEnabled="{Binding IsFree}">
<Grid DockPanel.Dock="Bottom">
</Grid>
<Grid Margin="0 20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="38*"/>
<ColumnDefinition Width="117*"/>
</Grid.ColumnDefinitions>
<local:MachineView Margin="30 80 0 0" DataContext="{Binding Machine}" IsHitTestVisible="False" VerticalAlignment="Top" Height="241" />
<DockPanel Grid.Column="1" Margin="50 100 50 50">
<Grid DockPanel.Dock="Bottom" Height="50">
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding DisplayMachineSetups}">Machine Setups</CheckBox>
<CheckBox IsChecked="{Binding DisplayApplicationUpdates}" Margin="30 0">Software Updates</CheckBox>
<CheckBox IsChecked="{Binding DisplayDatabaseUpdates}">Database Updates</CheckBox>
<CheckBox IsChecked="{Binding DisplaySynchronizations}" Margin="30 0 0 0">Synchronizations</CheckBox>
</StackPanel>
<Button Command="{Binding RefreshCommand}" HorizontalAlignment="Right" Width="150" Style="{StaticResource MaterialDesignFlatButton}">REFRESH</Button>
</Grid>
<Grid>
<DataGrid Margin="0 0 0 10" SelectionUnit="FullRow" BorderBrush="{StaticResource borderBrush }" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True" ItemsSource="{Binding Updates}" SelectedItem="{Binding SelectedUpdate}">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Header="">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<materialDesign:PackIcon Width="16" Height="16">
<materialDesign:PackIcon.Style>
<Style TargetType="materialDesign:PackIcon">
<Setter Property="Kind" Value="Information"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsSetup}" Value="True">
<Setter Property="Kind" Value="Settings"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsUpdate}" Value="True">
<Setter Property="Kind" Value="CloudDownload"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsDataBase}" Value="True">
<Setter Property="Kind" Value="Database"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsSynchronization}" Value="True">
<Setter Property="Kind" Value="Sync"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsOfflineUpdate}" Value="True">
<Setter Property="Kind" Value="Sd"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsStarted}" Value="True">
<Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsCompleted}" Value="True">
<Setter Property="Foreground" Value="{StaticResource GreenBrush }"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding IsFailed}" Value="True">
<Setter Property="Foreground" Value="Red"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</materialDesign:PackIcon.Style>
</materialDesign:PackIcon>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="STARTED" Binding="{Binding StartDate,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="Auto" />
<DataGridTextColumn Header="APPLICATION" Binding="{Binding ApplicationVersion}" Width="Auto" />
<DataGridTextColumn Header="FIRMWARE" Binding="{Binding FirmwareVersion}" Width="Auto" />
<DataGridTextColumn Header="ENDED" Binding="{Binding EndDate,TargetNullValue='Never',FallbackValue='Never',Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" Width="Auto" />
<DataGridTextColumn Header="STATUS" Binding="{Binding UpdateStatus,Converter={StaticResource EnumToDescriptionConverter}}" Width="Auto" />
<DataGridTextColumn Header="REASON" Binding="{Binding FailedReason,Converter={StaticResource StringToOneLineConverter},ConverterParameter='80'}" Width="*" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</DockPanel>
</Grid>
</DockPanel>
</Grid>
</UserControl>
|