diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-07-16 09:29:44 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-07-16 09:29:44 +0300 |
| commit | beed152bc9c9c004991b414613fef17e06737962 (patch) | |
| tree | 0aac90d453d846b6b1f2195f7211a3dc07280e8d /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | |
| parent | 230606f80543e12f04f7ca674a208de9d78ad3a1 (diff) | |
| parent | d376387fa28a2091a21e2fc7193812d1f8a40ef2 (diff) | |
| download | Tango-beed152bc9c9c004991b414613fef17e06737962.tar.gz Tango-beed152bc9c9c004991b414613fef17e06737962.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 40 |
1 files changed, 39 insertions, 1 deletions
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 405c19eb7..268f42ce9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; using Tango.Core.DI; +using Tango.Integration.Operation; using Tango.PPC.Common; using Tango.PPC.Common.Modules; using Tango.PPC.Common.Navigation; -using Tango.PPC.UI.Notifications.NotificationItems; using Tango.PPC.UI.ViewsContracts; using Tango.SharedUI; @@ -20,6 +20,8 @@ namespace Tango.PPC.UI.ViewModels /// <seealso cref="Tango.PPC.Common.PPCViewModel{Tango.PPC.UI.ViewsContracts.ILayoutView}" /> public class LayoutViewVM : PPCViewModel<ILayoutView> { + private JobHandler _jobHandler; + /// <summary> /// Gets or sets the module loader. /// </summary> @@ -67,6 +69,16 @@ namespace Tango.PPC.UI.ViewModels public RelayCommand NotificationsAreaPressedCommand { get; set; } /// <summary> + /// Gets or sets the stop printing command. + /// </summary> + public RelayCommand StopPrintingCommand { get; set; } + + /// <summary> + /// Gets or sets the sign-out command. + /// </summary> + public RelayCommand SignOutCommand { get; set; } + + /// <summary> /// Initializes a new instance of the <see cref="LayoutViewVM"/> class. /// </summary> public LayoutViewVM() @@ -75,6 +87,17 @@ namespace Tango.PPC.UI.ViewModels HomeCommand = new RelayCommand(NavigateHome); MenuOrBackCommand = new RelayCommand(OpenMenuOrNavigateBack); NotificationsAreaPressedCommand = new RelayCommand(OpenFirstNotificationOrDisplayAll); + + StopPrintingCommand = new RelayCommand(StopPrinting); + SignOutCommand = new RelayCommand(SignOut); + } + + private void StopPrinting() + { + if (_jobHandler != null) + { + _jobHandler.Cancel(); + } } /// <summary> @@ -118,6 +141,12 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationStarted(); ModuleLoader.ModulesLoaded += ModuleLoader_ModulesLoaded; + MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; + } + + private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) + { + _jobHandler = e.JobHandler; } /// <summary> @@ -139,6 +168,15 @@ namespace Tango.PPC.UI.ViewModels } /// <summary> + /// Represents an event that is raised when the sign-out operation is complete. + /// </summary> + private void SignOut() + { + AuthenticationProvider.LogOut(); + IsMenuOpened = false; + } + + /// <summary> /// Opens the first notification or display all. /// </summary> private void OpenFirstNotificationOrDisplayAll() |
