aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Views/SystemView.xaml
blob: d96da4f93d2c7d6728646ea8ba570dff9ea7653b (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
<UserControl x:Class="Tango.PPC.Technician.Views.SystemView"
             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:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             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:SystemViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.SystemViewVM}" x:Name="view">

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

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

        <Grid Grid.Row="1" Margin="20">

            <DockPanel>
                <UniformGrid DockPanel.Dock="Top" Columns="3" Margin="50" TextElement.FontSize="{StaticResource TangoHeaderFontSize}">
                    <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold">
                        <Run>CPU:</Run>
                        <Run Text="{Binding CPU,Mode=OneWay,StringFormat='0'}"></Run><Run>%</Run>
                    </TextBlock>

                    <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold">
                        <Run>RAM:</Run>
                        <Run Text="{Binding RAM,Mode=OneWay,Converter={StaticResource ByteArrayToFileSizeConverter},StringFormat='0'}"></Run>
                    </TextBlock>

                    <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold">
                        <Run>TEMP:</Run>
                        <Run Text="{Binding Temperature,Mode=OneWay,StringFormat='0 °C'}"></Run>
                    </TextBlock>
                </UniformGrid>

                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" TextElement.FontSize="{StaticResource TangoTitleFontSize}">
                    <touch:TouchButton Command="{Binding ResetDeviceCommand}" Height="60" Background="{StaticResource TangoErrorBrush}">Reset Machine</touch:TouchButton>
                    <touch:TouchButton Command="{Binding RestartCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Restart Device</touch:TouchButton>
                    <touch:TouchButton Command="{Binding ShutdownCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Shutdown Device</touch:TouchButton>
                    <touch:TouchButton Command="{Binding FactoryResetCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Factory Reset</touch:TouchButton>
                    <touch:TouchButton Command="{Binding ExitToExplorerCommand}" Height="60" Background="{StaticResource TangoErrorBrush}" Margin="0 20 0 0">Exit To Shell</touch:TouchButton>
                </StackPanel>
            </DockPanel>
        </Grid>
    </Grid>
</UserControl>