aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-04-18 14:47:53 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-04-18 14:47:53 +0300
commit1c7f16c34f85dd65a02ad08dde984f04a4d82b83 (patch)
tree74fb71b0959d1c7c1b9f09fdd636b3196b43aaf4 /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs
parent7c7d1078082c261c820297cb6e4e5cf301872e4f (diff)
downloadTango-1c7f16c34f85dd65a02ad08dde984f04a4d82b83.tar.gz
Tango-1c7f16c34f85dd65a02ad08dde984f04a4d82b83.zip
PPC Eureka. Power button, new dialog.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml56
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs69
3 files changed, 153 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml
new file mode 100644
index 000000000..f5b1116c0
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml
@@ -0,0 +1,56 @@
+<UserControl x:Class="Tango.PPC.UI.Dialogs.PowerEurekaView"
+ 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"
+ Width="500" Height="462"
+ Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="500" d:DataContext="{d:DesignInstance Type=local:PowerEurekaViewVM, IsDesignTimeCreatable=False}">
+ <UserControl.Resources>
+
+ <Style TargetType="touch:TouchButton" >
+ <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter>
+ <Setter Property="Background" Value="{StaticResource TangoPrimaryAccentBrush}"/>
+ <Setter Property="Height" Value="50"/>
+ <Setter Property="Width" Value="165"/>
+ <Setter Property="CornerRadius" Value="30"/>
+ <Setter Property="EnableDropShadow" Value="False"/>
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="FontSize" Value="18"/>
+ <Style.Triggers>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter>
+ <Setter Property="Background" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+
+ </UserControl.Resources>
+ <Grid>
+
+ <Border BorderBrush="{StaticResource TangoMidAccentBrush}" Margin="-24" CornerRadius="40" BorderThickness="1" Background="{StaticResource TangoPrimaryBackgroundBrush}">
+ <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="10">
+ <DockPanel VerticalAlignment="Top" Margin="0 20 0 18" Width="470">
+ <touch:TouchIconButton DockPanel.Dock="Right" VerticalAlignment="Center" Height="25" Width="25" Command="{Binding CloseCommand}" Foreground="{StaticResource TangoDarkForegroundBrush}" RippleBrush="{StaticResource TangoRippleDarkBrush}" Icon="Close" HorizontalAlignment="Right" />
+ <TextBlock FontSize="{StaticResource TangoButtonFontSize}" FontWeight="SemiBold" HorizontalAlignment="Center"> Power</TextBlock>
+ </DockPanel>
+ <Grid HorizontalAlignment="Center" Width="470" VerticalAlignment="Top" Margin="0 20 0 0">
+ <Image Source="../Images/Menu/Power_image.png" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Left" Height="50" Width="120"/>
+ <touch:TouchButton Margin="0" Command="{Binding TurnOffCommand}" HorizontalAlignment="Center"> Turn off</touch:TouchButton>
+ </Grid>
+ <touch:TouchButton Margin="0 35 0 0" Content="Stand By" Command="{Binding StandByCommand}" ></touch:TouchButton>
+ <touch:TouchButton Margin="0 35 0 0" Command="{Binding RestartCommand}">Restart</touch:TouchButton>
+ <Border Height="2" Width="380" Background="{StaticResource TangoLightBorderBrush}" VerticalAlignment="Bottom" Margin="0 36 0 0" CornerRadius="2"></Border>
+ <Grid Margin="0 43 0 43" VerticalAlignment="Bottom">
+ <Image Source="../Images/Menu/restart_t.png" Stretch="UniformToFill" HorizontalAlignment="Left" Width="30" VerticalAlignment="Center" Margin="46 0 0 0"/>
+ <touch:TouchButton Margin="0" Command="{Binding RestartTabletCommand}">Restart</touch:TouchButton>
+ </Grid>
+ </StackPanel>
+
+
+ </Border>
+
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml.cs
new file mode 100644
index 000000000..3279207bd
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.PPC.UI.Dialogs
+{
+ /// <summary>
+ /// Interaction logic for PowerEurekaView.xaml
+ /// </summary>
+ public partial class PowerEurekaView : UserControl
+ {
+ public PowerEurekaView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs
new file mode 100644
index 000000000..2dc8f7b6e
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/PowerEurekaViewVM.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Core.Commands;
+using Tango.SharedUI;
+
+namespace Tango.PPC.UI.Dialogs
+{
+ public class PowerEurekaViewVM : DialogViewVM
+ {
+ public enum PowerActionEnum { TurnOff, StandBy, Restart, RestartT };
+
+ private PowerActionEnum _powerAction;
+
+ public PowerActionEnum PowerAction
+ {
+ get { return _powerAction; }
+ set {
+ _powerAction = value;
+ RaisePropertyChangedAuto();}
+ }
+
+ public RelayCommand TurnOffCommand { get; set;}
+ public RelayCommand StandByCommand { get; set;}
+ public RelayCommand RestartCommand { get; set; }
+ public RelayCommand RestartTabletCommand { get; set; }
+
+
+ public PowerEurekaViewVM()
+ {
+ PowerAction = PowerActionEnum.StandBy;
+ TurnOffCommand = new RelayCommand( OnTurnOff);
+ StandByCommand = new RelayCommand(OnStandBy);
+ RestartCommand = new RelayCommand(OnRestart);
+ RestartTabletCommand = new RelayCommand(OnRestartTablet);
+ }
+
+ private void OnRestartTablet(object obj)
+ {
+ PowerAction = PowerActionEnum.RestartT;
+ base.Accept();
+ }
+
+ private void OnRestart(object obj)
+ {
+ PowerAction = PowerActionEnum.Restart;
+ base.Accept();
+ }
+
+ private void OnStandBy(object obj)
+ {
+ PowerAction = PowerActionEnum.StandBy;
+ base.Accept();
+ }
+
+ private void OnTurnOff(object obj)
+ {
+ PowerAction = PowerActionEnum.TurnOff;
+ base.Accept();
+ }
+
+ protected override void Cancel()
+ {
+ base.Cancel();
+ }
+ }
+}