diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-10-19 11:55:18 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-10-19 11:55:46 +0300 |
| commit | 3fc440bd00595d660299de7da0fce21945014df4 (patch) | |
| tree | 659136f5a55f206dd040cb28b176e3032c43654b /Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels | |
| parent | 81875b89c85e0785e4f575a6f24e05435cdec0af (diff) | |
| download | Tango-3fc440bd00595d660299de7da0fce21945014df4.tar.gz Tango-3fc440bd00595d660299de7da0fce21945014df4.zip | |
when a job is running, the "Edit job' button should be disabled.
Related Work Items: #9149
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index 5d8473018..dffa9b241 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -110,6 +110,17 @@ namespace Tango.PPC.Jobs.ViewModels } } + public bool CanDropResume + { + get + { + return Job != null && HasResumeModel && + (!MachineProvider.MachineOperator.IsPrinting + || (MachineProvider.MachineOperator.RunningJob != null + && MachineProvider.MachineOperator.RunningJob.Guid != Job.Guid)); + } + } + private ICollectionView _segmentsCollectionView; /// <summary> /// Gets or sets the job segments collection view. @@ -423,7 +434,7 @@ namespace Tango.PPC.Jobs.ViewModels CopyCommand = new RelayCommand(Copy); UndoCommand = new RelayCommand(Undo);//(x) => { return UndoRedoManager.Instance.IsEnableUndoOperation(); } RedoCommand = new RelayCommand(Redo);//(x) => { return UndoRedoManager.Instance.IsEnableRedoOperation();} - DropResumeCommand = new RelayCommand(DropResume); + DropResumeCommand = new RelayCommand(DropResume, (x)=> CanDropResume); NavigateBackToJobs = new RelayCommand(NavigateBack); @@ -510,6 +521,7 @@ namespace Tango.PPC.Jobs.ViewModels } RaisePropertyChanged(nameof(CanEdit)); + DropResumeCommand.RaiseCanExecuteChanged(); Job.NameChanged -= Job_NameChanged; Job.NameChanged += Job_NameChanged; @@ -768,6 +780,7 @@ namespace Tango.PPC.Jobs.ViewModels var handler = await PrintingManager.Print(Job, _db, printConfig); RaisePropertyChanged(nameof(CanEdit)); + DropResumeCommand.RaiseCanExecuteChanged(); if (!BuildProvider.IsEureka) { @@ -1773,6 +1786,10 @@ namespace Tango.PPC.Jobs.ViewModels private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) { RaisePropertyChanged(nameof(CanEdit)); + InvokeUI( () => + { + DropResumeCommand.RaiseCanExecuteChanged(); + }); } private void MachineOperator_PrintingEnded(object sender, Integration.Operation.PrintingEventArgs e) @@ -1783,6 +1800,10 @@ namespace Tango.PPC.Jobs.ViewModels } RaisePropertyChanged(nameof(CanEdit)); + InvokeUI(() => + { + DropResumeCommand.RaiseCanExecuteChanged(); + }); } |
