aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EventDetailsView.xaml
blob: c75ef41eed1774157ef98a99abd0a9730833778b (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
<UserControl x:Class="Tango.MachineStudio.Logging.Views.EventDetailsView"
             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:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:vm="clr-namespace:Tango.MachineStudio.Logging.ViewModels"
             xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views"
             mc:Ignorable="d" 
             Height="500" Width="800" Background="White" d:DataContext="{d:DesignInstance Type=vm:EventDetailsViewVM, IsDesignTimeCreatable=False}">

    <UserControl.Resources>
        <converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" />
    </UserControl.Resources>

    <Grid>
        <Grid Grid.RowSpan="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="60"/>
                <RowDefinition Height="31*"/>
                <RowDefinition Height="50"/>
            </Grid.RowDefinitions>

            <StackPanel Orientation="Horizontal">
                <materialDesign:PackIcon Width="42" Height="42" VerticalAlignment="Center">
                    <materialDesign:PackIcon.Style>
                        <Style TargetType="materialDesign:PackIcon">
                            <Setter Property="Kind" Value="Alert"></Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Event.Category}" Value="Info">
                                    <Setter Property="Kind" Value="Information"></Setter>
                                    <Setter Property="Foreground" Value="DimGray"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Event.Category}" Value="Warning">
                                    <Setter Property="Kind" Value="Alert"></Setter>
                                    <Setter Property="Foreground" Value="#FFA300"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Event.Category}" Value="Error">
                                    <Setter Property="Kind" Value="AlertOctagon"></Setter>
                                    <Setter Property="Foreground" Value="#FF5C5C"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Event.Category}" Value="Critical">
                                    <Setter Property="Kind" Value="BellPlus"></Setter>
                                    <Setter Property="Foreground" Value="Red"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Event.Type}" Value="ApplicationStarted">
                                    <Setter Property="Kind" Value="ClockFast"></Setter>
                                    <Setter Property="Foreground" Value="White"></Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </materialDesign:PackIcon.Style>
                </materialDesign:PackIcon>
                <TextBlock VerticalAlignment="Center" Text="{Binding Event.EventType.Name}" Margin="10 0 0 0" FontSize="16"></TextBlock>
            </StackPanel>

            <Grid Grid.Row="1">
                <DockPanel>
                    <UniformGrid Columns="2" DockPanel.Dock="Top">
                        <controls:TableGrid RowHeight="30">
                            <TextBlock Text="Date:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Event.DateTime,Converter={StaticResource DateTimeUTCToStringConverter},ConverterParameter='MM/dd/yyyy HH:mm:ss.fff'}"></TextBlock>
                            <TextBlock Text="Host Name:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Event.HostName}"></TextBlock>
                            <TextBlock Text="Machine:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Event.Machine.SerialNumber}"></TextBlock>
                            <TextBlock Text="User:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Event.User.Contact.FullName}"></TextBlock>
                        </controls:TableGrid>

                        <controls:TableGrid RowHeight="30">
                            <TextBlock Text="Category:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Event.EventType.EventTypesCategory.Name}"></TextBlock>
                            <TextBlock Text="Group:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Event.EventType.EventTypesGroup.Name}"></TextBlock>
                        </controls:TableGrid>
                    </UniformGrid>

                    <Border Padding="5" BorderThickness="1" BorderBrush="Gainsboro">
                        <TextBox BorderThickness="0" Text="{Binding Event.Description}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Background="Transparent" />
                    </Border>
                </DockPanel>
            </Grid>

            <Grid Grid.Row="2">
                <Button HorizontalAlignment="Right" Width="140" Command="{Binding CloseCommand}">CLOSE</Button>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
"0"/> <Setter Property="MinHeight" Value="0"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/> <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TextBox}"> <ScrollViewer x:Name="PART_ContentHost" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" Focusable="false" Background="Transparent"/> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="TangoComboboxStyle" TargetType="{x:Type ComboBox}"> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="Foreground" Value="{DynamicResource ControlForegroundKey}"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="BorderBrush" Value="{DynamicResource Inactive.Selection}"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Margin" Value="1,0"/> <Setter Property="Padding" Value="0"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> <Setter Property="ScrollViewer.PanningMode" Value="Both"/> <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> <Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="MinHeight" Value="18"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ComboBox}"> <Grid SnapsToDevicePixels="true"> <Grid Grid.IsSharedSizeScope="true"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition SharedSizeGroup="ComboBoxButton" Width="Auto"/> </Grid.ColumnDefinitions> <Border x:Name="Background" Background="{TemplateBinding Background}"/> <Border x:Name="SelectedContentBorder" Margin="2,2,1,2"> <ContentPresenter x:Name="ContentSite" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Content="{TemplateBinding SelectionBoxItem}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/> </Border> <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2"/> <ToggleButton x:Name="DropDownButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ToolBarComboBoxTransparentButtonStyle}"/> <TextBox x:Name="PART_EditableTextBox" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="1,1,0,1" MinHeight="18" Padding="{TemplateBinding Padding}" Style="{StaticResource ComboBoxEditableTextBox}" Visibility="Collapsed" VerticalAlignment="Center"/> </Grid> <Popup x:Name="PART_Popup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom"> <Border x:Name="DropDownBorder" BorderBrush="{DynamicResource ComboboxDropDownBorder}" BorderThickness="1" Background="{DynamicResource ComboboxDropDownBackground}" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Margin="2,0,0,0"> <ScrollViewer x:Name="DropDownScrollViewer"> <Grid RenderOptions.ClearTypeHint="Enabled"> <Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> <Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/> </Canvas> <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained"/> </Grid> </ScrollViewer> </Border> </Popup> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/> <Setter Property="Background" TargetName="Background" Value="{DynamicResource ToolBarDisabledFill}"/> <Setter Property="Grid.ColumnSpan" TargetName="Background" Value="2"/> <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ToolBarDisabledBorder}"/> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsKeyboardFocusWithin" Value="true"/> <Condition Property="IsDropDownOpen" Value="false"/> <Condition Property="IsEditable" Value="false"/> </MultiTrigger.Conditions> <Setter Property="Background" TargetName="SelectedContentBorder" Value="{DynamicResource ListBorder}"/> <Setter Property="Foreground" Value="{DynamicResource ControlForegroundKey}"/> </MultiTrigger> <Trigger Property="IsEditable" Value="true"> <Setter Property="Background" TargetName="DropDownButton" Value="{x:Null}"/> <Setter Property="Visibility" TargetName="ContentSite" Value="Collapsed"/> <Setter Property="Visibility" TargetName="PART_EditableTextBox" Value="Visible"/> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="BorderBrush" TargetName="DropDownButton" Value="{DynamicResource ToolBarButtonHoverBorder}"/> <Setter Property="Background" TargetName="DropDownButton" Value="{DynamicResource DropDownButtonHover}"/> <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ToolBarButtonHoverBorder}"/> </Trigger> <Trigger Property="IsKeyboardFocusWithin" Value="true"> <Setter Property="BorderBrush" TargetName="DropDownButton" Value="{DynamicResource ToolBarButtonHoverBorder}"/> <Setter Property="Background" TargetName="DropDownButton" Value="{DynamicResource DropDownButtonHover}"/> <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ToolBarButtonHoverBorder}"/> </Trigger> <Trigger Property="HasItems" Value="false"> <Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsGrouping" Value="true"/> <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/> </MultiTrigger.Conditions> <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> </MultiTrigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsKeyboardFocusWithin" Value="true"/> <Condition Property="IsDropDownOpen" Value="false"/> <Condition Property="IsEditable" Value="false"/> </MultiTrigger.Conditions> <Setter Property="Foreground" Value="{DynamicResource ControlForegroundKey}"/> </MultiTrigger> <Trigger Property="IsEditable" Value="true"> <Setter Property="Padding" Value="2"/> <Setter Property="IsTabStop" Value="false"/> </Trigger> <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false"> <Setter Property="Canvas.Top" TargetName="OpaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/> <Setter Property="Canvas.Left" TargetName="OpaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Resources> <Style TargetType="{x:Type ComboBoxItem}"> <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" /> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ComboBoxItem}"> <Border x:Name="ItemBorder" Background="{DynamicResource ComboboxItemBackground}" BorderBrush="Transparent" BorderThickness="1"> <ContentPresenter /> </Border> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Background" TargetName="ItemBorder" Value="{DynamicResource ComboboxItemMouseOverBackground}"/> </Trigger> <Trigger Property="IsKeyboardFocusWithin" Value="true"> <Setter Property="Background" TargetName="ItemBorder" Value="{DynamicResource ComboboxItemMouseOverBackground}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Style.Resources> </Style> </ResourceDictionary>