aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/LoggingView.xaml
blob: a1cdaf98772170d1d166dea2f1c029d8d2da390b (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
<UserControl x:Class="Tango.PPC.Technician.Views.LoggingView"
             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:global="clr-namespace:Tango.PPC.Technician"
             mc:Ignorable="d" 
             d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LoggingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoggingViewVM}">

    <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">Logging</TextBlock>
        </Border>

        <Grid Grid.Row="1">

            <DockPanel>
                <DockPanel DockPanel.Dock="Top">
                    <StackPanel Orientation="Horizontal">
                        <touch:TouchNavigationLinks Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}">
                            <sys:String>Application</sys:String>
                            <sys:String>Embedded</sys:String>
                        </touch:TouchNavigationLinks>

                        <StackPanel Orientation="Horizontal" Margin="20 3 0 0">
                            <touch:TouchToggleIconButton Icon="Pause" Width="32" Height="32" Padding="7" CheckedIcon="Play" IsChecked="{Binding IsPaused}"></touch:TouchToggleIconButton>
                            <touch:TouchIconButton Margin="10 0 0 0" Icon="TrashAltRegular" Foreground="{StaticResource TangoDarkForegroundBrush}" Width="32" Height="32" Padding="7" Command="{Binding ClearCommand}"></touch:TouchIconButton>

                            <StackPanel Orientation="Horizontal" Margin="20 0 0 0">
                                <touch:TouchIcon Icon="Magnify" Foreground="{StaticResource TangoGrayBrush}" Width="16" Height="16" />
                                <touch:TouchTextBox Width="200" VerticalAlignment="Center" Margin="5 -10 0 0" Text="{Binding Filter}"></touch:TouchTextBox>
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                    <touch:TouchDatePicker Visibility="Collapsed" SelectedDate="12/15/2018" Height="40" />
                </DockPanel>

                <Grid Margin="20">
                    <ListBox VirtualizingPanel.ScrollUnit="Pixel" VirtualizingPanel.IsVirtualizing="True" Style="{StaticResource BlankListBox}" ItemsSource="{Binding ApplicationLogsViewSource}" SelectionMode="Single">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VirtualizingStackPanel />
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="ListBoxItem" BasedOn="{StaticResource BlankListBoxItem}">
                                <Setter Property="Height" Value="125"></Setter>
                                <Style.Triggers>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter Property="Height" Value="Auto"></Setter>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </ListBox.ItemContainerStyle>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" Margin="5" Padding="5" CornerRadius="5" IsHitTestVisible="False">
                                    <Border.Style>
                                        <Style TargetType="Border">
                                            <Setter Property="BorderBrush" Value="{StaticResource TangoLightBorderBrush}"></Setter>
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Category}" Value="Warning">
                                                    <Setter Property="BorderBrush" Value="{StaticResource TangoWarningBrush}"></Setter>
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding Category}" Value="Error">
                                                    <Setter Property="BorderBrush" Value="{StaticResource TangoErrorBrush}"></Setter>
                                                </DataTrigger>
                                                <DataTrigger Binding="{Binding Category}" Value="Critical">
                                                    <Setter Property="BorderBrush" Value="{StaticResource TangoErrorBrush}"></Setter>
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Border.Style>
                                    <StackPanel>
                                        <TextBlock>
                                        <Run>Time:</Run>
                                        <Run Text="{Binding TimeStamp,Converter={StaticResource DateTimeUTCToStringConverter},Mode=OneWay,ConverterParameter='hh\\:mm\\:ss.ff'}" FontWeight="SemiBold"></Run>
                                        </TextBlock>
                                        <TextBlock Margin="0 2 0 0">
                                        <Run>File:</Run>
                                        <Run Text="{Binding RelativeCallerFile,Mode=OneWay}" FontWeight="SemiBold"></Run>
                                        </TextBlock>
                                        <TextBlock Margin="0 2 0 0">
                                        <Run>Method:</Run>
                                        <Run Text="{Binding CallerMethodName,Mode=OneWay}" FontWeight="SemiBold"></Run>
                                        </TextBlock>
                                        <TextBlock Margin="0 2 0 0">
                                        <Run>Line:</Run>
                                        <Run Text="{Binding CallerLineNumber,Mode=OneWay}" FontWeight="SemiBold"></Run>
                                        </TextBlock>
                                        <TextBlock Margin="0 2 0 0" TextTrimming="WordEllipsis" TextWrapping="Wrap">
                                        <Run>Message:</Run>
                                        <Run Text="{Binding Message,Mode=OneWay}" FontWeight="SemiBold"></Run>
                                        </TextBlock>
                                    </StackPanel>
                                </Border>

                                    <touch:TouchIcon HorizontalAlignment="Right" VerticalAlignment="Top" Margin="15" Width="16" Height="16">
                                        <touch:TouchIcon.Style>
                                            <Style TargetType="touch:TouchIcon" BasedOn="{StaticResource {x:Type touch:TouchIcon}}">
                                                <Setter Property="Icon" Value="ChevronDown"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,IsAsync=True}" Value="True">
                                                        <Setter Property="Icon" Value="ChevronUp"></Setter>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </touch:TouchIcon.Style>
                                    </touch:TouchIcon>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </DockPanel>

        </Grid>
    </Grid>
</UserControl>