aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/EventsViews/GeneralView.xaml
blob: 2b34357345b1e8ee1f8697c497b780c23547379a (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
<UserControl x:Class="Tango.PPC.Events.EventsViews.GeneralView"
             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:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             xmlns:converters="clr-namespace:Tango.PPC.Events.Converters"
             xmlns:local="clr-namespace:Tango.PPC.Events.EventsViews"
             mc:Ignorable="d" 
             d:DesignHeight="220" d:DesignWidth="750" d:DataContext="{d:DesignInstance Type=entities:MachinesEvent, IsDesignTimeCreatable=False}">
    <UserControl.Resources>
        <converters:MachineEventToMachineTypeConverter x:Key="MachineEventToMachineTypeConverter" />
    </UserControl.Resources>
    <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
        <DockPanel>
            <Image Margin="20" Stretch="None" DockPanel.Dock="Right" RenderOptions.BitmapScalingMode="Fant">
                <Image.Style>
                    <Style TargetType="Image">
                        <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="TS1800">
                                <Setter Property="Source" Value="../Images/machine_small.png"></Setter>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="Eureka">
                                <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Converter={StaticResource MachineEventToMachineTypeConverter}}" Value="X1">
                                <Setter Property="Source" Value="../Images/machine_small_X4.png"></Setter>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
            <DockPanel Margin="35 20 20 20">
                <TextBlock FontSize="{StaticResource TangoTitleFontSize}" FontWeight="SemiBold" DockPanel.Dock="Top" Text="{Binding EventType,Converter={StaticResource EventTypeTitleConverter},FallbackValue='Unknown Event'}"></TextBlock>

                <StackPanel Margin="0 30 0 0">
                    <TextBlock TextWrapping="Wrap" FontWeight="SemiBold" Text="{Binding EventType,Converter={StaticResource EventTypeDescriptionConverter},FallbackValue='No Description'}"></TextBlock>
                    <Rectangle Margin="0 5 0 10" StrokeThickness="2" Stroke="{StaticResource TangoDividerBrush}" />

                    <ItemsControl ItemsSource="{Binding EventType.Guidance,Converter={StaticResource StringToLinesConverter}}">
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Margin="0 10 0 0" Text="{Binding}" TextWrapping="Wrap"></TextBlock>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </StackPanel>
            </DockPanel>
        </DockPanel>
    </Grid>
</UserControl>