From ba4aec4c691476d68b3da383a70bff42341c7171 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 23 Apr 2019 16:13:41 +0300 Subject: Implemented screen lock for PPC. --- .../PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml | 30 ++++++++++++++++++ .../Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs | 36 ++++++++++++++++++++++ .../PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs | 19 ++++++++++++ .../Dialogs/TechnicianModeLoginView.xaml | 7 ++++- .../Dialogs/TechnicianModeLoginView.xaml.cs | 8 +++++ 5 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ScreenLockViewVM.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs') 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 @@ + + + + + + + + + CANCEL + OK + + + + + Screen Locked + Please enter the password to unlock the screen. + + + + + + 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 +{ + /// + /// Interaction logic for TechnicianModeLoginView.xaml + /// + 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}"> + + + + + @@ -18,7 +23,7 @@ Technician Mode Please enter the technician mode password. - + 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(); } } } -- cgit v1.3.1