diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-12 19:07:24 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-12 19:07:24 +0300 |
| commit | 33a68a0e46e55e86a4c1f100ea3d7e9180a801a3 (patch) | |
| tree | 52e10805c666d22fd5d8f004eeb06edffd22df90 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels | |
| parent | 7b86ad443156b9b9bac43082a638e0d55f784a94 (diff) | |
| download | Tango-33a68a0e46e55e86a4c1f100ea3d7e9180a801a3.tar.gz Tango-33a68a0e46e55e86a4c1f100ea3d7e9180a801a3.zip | |
Working on PPC & Tango.Integration.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 24 |
1 files changed, 24 insertions, 0 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..b3a0c5b1a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -5,6 +5,7 @@ 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; @@ -20,6 +21,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 +70,11 @@ 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> /// Initializes a new instance of the <see cref="LayoutViewVM"/> class. /// </summary> public LayoutViewVM() @@ -75,6 +83,21 @@ namespace Tango.PPC.UI.ViewModels HomeCommand = new RelayCommand(NavigateHome); MenuOrBackCommand = new RelayCommand(OpenMenuOrNavigateBack); NotificationsAreaPressedCommand = new RelayCommand(OpenFirstNotificationOrDisplayAll); + + StopPrintingCommand = new RelayCommand(StopPrinting); + } + + private void StopPrinting() + { + if (_jobHandler != null) + { + _jobHandler.Cancel(); + } + } + + private void MachineOperator_PrintingStarted(object sender, Integration.Operation.JobHandler jobHandler) + { + _jobHandler = jobHandler; } /// <summary> @@ -118,6 +141,7 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationStarted(); ModuleLoader.ModulesLoaded += ModuleLoader_ModulesLoaded; + MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; } /// <summary> |
