aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-04-23 16:13:41 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-04-23 16:13:41 +0300
commitba4aec4c691476d68b3da383a70bff42341c7171 (patch)
treecff1ec9b2b4c6bc09ceb4d2a7a64f8cf1e6a8fc0 /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs
parent2c48f9ef5ee4978f531e18d0c5945f33705bfe46 (diff)
downloadTango-ba4aec4c691476d68b3da383a70bff42341c7171.tar.gz
Tango-ba4aec4c691476d68b3da383a70bff42341c7171.zip
Implemented screen lock for PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml30
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs36
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs19
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml7
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs8
5 files changed, 99 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml
new file mode 100644
index 000000000..8a90b03a0
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml
@@ -0,0 +1,30 @@
+<UserControl x:Class="Tango.PPC.UI.Dialogs.ScreenLockView"
+ 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:local="clr-namespace:Tango.PPC.UI.Dialogs"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ mc:Ignorable="d"
+ Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="600" Height="250" d:DataContext="{d:DesignInstance Type=local:ScreenLockViewVM, IsDesignTimeCreatable=False}">
+
+ <UserControl.InputBindings>
+ <KeyBinding Key="Return" Command="{Binding OKCommand}"></KeyBinding>
+ </UserControl.InputBindings>
+ <Grid Margin="10">
+ <DockPanel>
+ <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal">
+ <touch:TouchButton Command="{Binding CloseCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton>
+ <touch:TouchButton Command="{Binding OKCommand}" Style="{StaticResource TangoMessageBoxButton}" DockPanel.Dock="Right" Width="120" Height="50" VerticalAlignment="Bottom">OK</touch:TouchButton>
+ </StackPanel>
+ <DockPanel>
+ <touch:TouchIcon Foreground="{StaticResource TangoErrorBrush}" Icon="Lock" VerticalAlignment="Top" Height="70"></touch:TouchIcon>
+ <StackPanel Margin="10 0 0 0">
+ <TextBlock FontSize="{StaticResource TangoHeaderFontSize}">Screen Locked</TextBlock>
+ <TextBlock Margin="0 10 0 0" TextWrapping="Wrap">Please enter the password to unlock the screen.</TextBlock>
+ <touch:TouchTextBox x:Name="txtPassword" Margin="0 30 40 0" IsPassword="True" KeyboardAction="Go" Text="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
+ </StackPanel>
+ </DockPanel>
+ </DockPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs
new file mode 100644
index 000000000..4a28984e6
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs
@@ -0,0 +1,36 @@
+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 TechnicianModeLoginView.xaml
+ /// </summary>
+ public partial class ScreenLockView : UserControl
+ {
+ public ScreenLockView()
+ {
+ InitializeComponent();
+
+ Loaded += ScreenLockView_Loaded;
+ }
+
+ private async void ScreenLockView_Loaded(object sender, RoutedEventArgs e)
+ {
+ await Task.Delay(200);
+ txtPassword.Focus();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs
new file mode 100644
index 000000000..e19117621
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.SharedUI;
+
+namespace Tango.PPC.UI.Dialogs
+{
+ public class ScreenLockViewVM : DialogViewVM
+ {
+ private String _password;
+ public String Password
+ {
+ get { return _password; }
+ set { _password = value; RaisePropertyChangedAuto(); }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml
index ca53d6027..24a5416ba 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml
@@ -7,6 +7,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="600" Height="250" d:DataContext="{d:DesignInstance Type=local:TechnicianModeLoginViewVM, IsDesignTimeCreatable=False}">
+
+ <UserControl.InputBindings>
+ <KeyBinding Key="Return" Command="{Binding OKCommand}"></KeyBinding>
+ </UserControl.InputBindings>
+
<Grid Margin="10">
<DockPanel>
<StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal">
@@ -18,7 +23,7 @@
<StackPanel Margin="10 0 0 0">
<TextBlock FontSize="{StaticResource TangoHeaderFontSize}">Technician Mode</TextBlock>
<TextBlock Margin="0 10 0 0" TextWrapping="Wrap">Please enter the technician mode password.</TextBlock>
- <touch:TouchTextBox Margin="0 30 40 0" IsPassword="True" Text="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
+ <touch:TouchTextBox x:Name="txtPassword" KeyboardAction="Go" Margin="0 30 40 0" IsPassword="True" Text="{Binding Password,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</DockPanel>
</DockPanel>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs
index 02dfed896..3a809b6f3 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/TechnicianModeLoginView.xaml.cs
@@ -23,6 +23,14 @@ namespace Tango.PPC.UI.Dialogs
public TechnicianModeLoginView()
{
InitializeComponent();
+
+ Loaded += TechnicianModeLoginView_Loaded;
+ }
+
+ private async void TechnicianModeLoginView_Loaded(object sender, RoutedEventArgs e)
+ {
+ await Task.Delay(200);
+ txtPassword.Focus();
}
}
}