From de5700549a5fe01862f71d452f2abe4a74996605 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 15 Jul 2018 14:16:26 +0300 Subject: Implemented PPC twine animated gif. Sign out. Implemented TangoInject attribute 'When Available' mode! --- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 15 +++++++++++++++ .../PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | 8 ++++++++ 2 files changed, 23 insertions(+) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 062ade9cf..268f42ce9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -73,6 +73,11 @@ namespace Tango.PPC.UI.ViewModels /// public RelayCommand StopPrintingCommand { get; set; } + /// + /// Gets or sets the sign-out command. + /// + public RelayCommand SignOutCommand { get; set; } + /// /// Initializes a new instance of the class. /// @@ -84,6 +89,7 @@ namespace Tango.PPC.UI.ViewModels NotificationsAreaPressedCommand = new RelayCommand(OpenFirstNotificationOrDisplayAll); StopPrintingCommand = new RelayCommand(StopPrinting); + SignOutCommand = new RelayCommand(SignOut); } private void StopPrinting() @@ -161,6 +167,15 @@ namespace Tango.PPC.UI.ViewModels } + /// + /// Represents an event that is raised when the sign-out operation is complete. + /// + private void SignOut() + { + AuthenticationProvider.LogOut(); + IsMenuOpened = false; + } + /// /// Opens the first notification or display all. /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs index dd54873ce..022efd9b8 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs @@ -54,7 +54,15 @@ namespace Tango.PPC.UI.ViewModels public override void OnApplicationStarted() { + AuthenticationProvider.CurrentUserChanged += AuthenticationProvider_CurrentUserChanged; + } + private void AuthenticationProvider_CurrentUserChanged(object sender, BL.Entities.User user) + { + if (user == null) + { + Password = String.Empty; + } } private void Login() -- cgit v1.3.1