aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-04-23 22:25:54 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-04-23 22:25:54 +0300
commitebcb9ce27131e4bbd14c96b5f897a67bc752aaeb (patch)
tree293aee8b1751ce7fce542645722c0f1a96b73097 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
parent52967e858bd52621208f6360e84f4c47ec435816 (diff)
parent636ad730569dfef1a4ee04c8d716d510bcc47ee1 (diff)
downloadTango-ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb.tar.gz
Tango-ebcb9ce27131e4bbd14c96b5f897a67bc752aaeb.zip
merge alarm handling from remote
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs26
1 files changed, 25 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
index 264f41131..103a10b28 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
@@ -4,12 +4,14 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
+using Tango.Core.Commands;
using Tango.Integration.Operation;
using Tango.PPC.Common;
using Tango.PPC.Common.Navigation;
using Tango.PPC.Jobs.AppBarItems;
using Tango.PPC.Jobs.AppButtons;
using Tango.PPC.Jobs.Dialogs;
+using Tango.PPC.Jobs.NavigationObjects;
using Tango.PPC.Jobs.Views;
namespace Tango.PPC.Jobs.ViewModels
@@ -47,10 +49,24 @@ namespace Tango.PPC.Jobs.ViewModels
#endregion
+ #region Commands
+
+ /// <summary>
+ /// Gets or sets the go to job command.
+ /// </summary>
+ /// <value>
+ /// The go to job command.
+ /// </value>
+ public RelayCommand GoToJobCommand { get; set; }
+
+ #endregion
+
public JobProgressViewVM()
{
_stop_job_btn = new StopPrintingButton();
_stop_job_btn.Pressed += _stop_job_btn_Pressed;
+
+ GoToJobCommand = new RelayCommand(GoToJob);
}
private void _stop_job_btn_Pressed()
@@ -61,6 +77,12 @@ namespace Tango.PPC.Jobs.ViewModels
}
}
+ private void GoToJob()
+ {
+ NavigationManager.NavigateWithObject<JobsModule, JobView, JobNavigationObject>(new JobNavigationObject() { Job = _handler.Job });
+ NavigationManager.ClearHistoryExcept<JobsView>();
+ }
+
#region Override Methods
/// <summary>
@@ -78,7 +100,7 @@ namespace Tango.PPC.Jobs.ViewModels
{
base.OnNavigatedFrom();
- if (MachineProvider.MachineOperator.IsPrinting)
+ if (MachineProvider.MachineOperator.IsPrinting && _handler != null && !_handler.IsCanceled)
{
NotificationProvider.PushAppBarItem<JobProgressAppBarItem>().Pressed += (_, __) =>
{
@@ -119,6 +141,8 @@ namespace Tango.PPC.Jobs.ViewModels
e.JobHandler.StatusChanged += JobHandler_StatusChanged;
e.JobHandler.SpoolChangeRequired += JobHandler_SpoolChangeRequired;
e.JobHandler.Stopped += JobHandler_Stopped;
+
+ _stop_job_btn.Push();
}
/// <summary>