aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsView.xaml
blob: 170422bc3f12914b692cd02580c9f8b47d630530 (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
<UserControl x:Class="Tango.PPC.UI.Dialogs.BitResultsView"
             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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs"
             mc:Ignorable="d" 
             Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="750" Height="1000" d:DataContext="{d:DesignInstance Type=local:BitResultsViewVM, IsDesignTimeCreatable=False}">
    <Grid Margin="20">
        <DockPanel>

            <Grid DockPanel.Dock="Bottom" Margin="0 20 0 0">
                <touch:TouchButton HorizontalAlignment="Center" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="180" Height="50" VerticalAlignment="Bottom">CLOSE</touch:TouchButton>
            </Grid>

            <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center">
                <Image Source="../Images/bit_new.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant" Width="110" />
                <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Machine BIT Results</TextBlock>
            </StackPanel>

            <Grid>
                <touch:TouchSimpleDataGrid FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoDarkForegroundBrush}" Visibility="{Binding IsFree,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 20 0 0" IsReadOnly="True" ItemsSource="{Binding Results}" 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" VerticalGridLinesBrush="{x:Null}" HorizontalGridLinesBrush="{StaticResource TangoGrayBrush}" RowHeight="40" 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.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 TangoDarkForegroundBrush}" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGrid.CellStyle>
                    <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.Columns>
                        <DataGridTemplateColumn Header="" Width="40">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <touch:TouchIcon Width="16">
                                        <touch:TouchIcon.Style>
                                            <Style TargetType="touch:TouchIcon" BasedOn="{StaticResource {x:Type touch:TouchIcon}}">
                                                <Setter Property="Icon" Value="SkipNextCircleOutline"></Setter>
                                                <Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding BitResult.Status}" Value="Passed">
                                                        <Setter Property="Icon" Value="Check"></Setter>
                                                        <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter>
                                                    </DataTrigger>
                                                    <DataTrigger Binding="{Binding BitResult.Status}" Value="Failed">
                                                        <Setter Property="Icon" Value="Alert"></Setter>
                                                        <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter>
                                                    </DataTrigger>
                                                    <DataTrigger Binding="{Binding BitResult.Status}" Value="Warning">
                                                        <Setter Property="Icon" Value="Alert"></Setter>
                                                        <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </touch:TouchIcon.Style>
                                    </touch:TouchIcon>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Header="Test" Width="360">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock TextTrimming="CharacterEllipsis">
                                        <Run>#</Run><Run Text="{Binding BitType.Code,Mode=OneWay}"></Run>
                                        <Run Text="{Binding BitType.Description,Mode=OneWay}"></Run>
                                    </TextBlock>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <!--<DataGridTextColumn Header="Subject" Width="100" Binding="{Binding BitType.Subject}" />-->
                        <DataGridTextColumn Header="Description" Width="1*" Binding="{Binding BitResult.Description}" />
                    </DataGrid.Columns>
                </touch:TouchSimpleDataGrid>

                <Grid Visibility="{Binding IsFree,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
                    <StackPanel VerticalAlignment="Center">
                        <touch:TouchBusyIndicator Width="100" Height="100" IsIndeterminate="True" Foreground="{StaticResource TangoGrayBrush}" StrokeThickness="3" />
                        <TextBlock HorizontalAlignment="Center" Margin="0 15 0 0" FontSize="{StaticResource TangoButtonFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">Fetching BIT results, please wait...</TextBlock>
                    </StackPanel>
                </Grid>

                <Grid Visibility="{Binding BitSuccessful,Converter={StaticResource BooleanToVisibilityConverter}}">
                    <StackPanel VerticalAlignment="Center">
                        <touch:TouchIcon Icon="Check" Width="100" Height="100" Foreground="{StaticResource TangoSuccessBrush}" />
                        <TextBlock HorizontalAlignment="Center" Margin="0 15 0 0" FontSize="{StaticResource TangoButtonFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">All tests passed successfully</TextBlock>
                    </StackPanel>
                </Grid>
            </Grid>
        </DockPanel>
    </Grid>
</UserControl>