aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
diff options
context:
space:
mode:
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.cs17
1 files changed, 7 insertions, 10 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 03cd5bfff..b4a30cb39 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
@@ -9,6 +9,7 @@ using Tango.Integration.Operation;
using Tango.PMR.Printing;
using Tango.PPC.Common;
using Tango.PPC.Common.Navigation;
+using Tango.PPC.Common.Notifications;
using Tango.PPC.Jobs.AppBarItems;
using Tango.PPC.Jobs.AppButtons;
using Tango.PPC.Jobs.Dialogs;
@@ -25,6 +26,7 @@ namespace Tango.PPC.Jobs.ViewModels
{
private StopPrintingButton _stop_job_btn;
private JobHandler _handler;
+ private JobProgressAppBarItem _appBarItem;
#region Properties
@@ -142,9 +144,10 @@ namespace Tango.PPC.Jobs.ViewModels
if (MachineProvider.MachineOperator.IsPrinting && _handler != null && !_handler.IsCanceled)
{
- NotificationProvider.PushAppBarItem<JobProgressAppBarItem>().Pressed += (_, __) =>
+ _appBarItem = NotificationProvider.PushAppBarItem<JobProgressAppBarItem>();
+ _appBarItem.Pressed += (_, __) =>
{
- NotificationProvider.CurrentAppBarItem.Close();
+ _appBarItem?.Close();
NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView));
};
}
@@ -159,10 +162,7 @@ namespace Tango.PPC.Jobs.ViewModels
IsDisplayJobOutline = false;
- if (NotificationProvider.HasAppBarItem && NotificationProvider.CurrentAppBarItem is JobProgressAppBarItem)
- {
- NotificationProvider.CurrentAppBarItem.Close();
- }
+ _appBarItem?.Close();
if (_handler != null && !_handler.Status.IsFailed)
{
@@ -232,10 +232,7 @@ namespace Tango.PPC.Jobs.ViewModels
_stop_job_btn.Pop();
}
- if (NotificationProvider.HasAppBarItem && NotificationProvider.CurrentAppBarItem is JobProgressAppBarItem)
- {
- NotificationProvider.CurrentAppBarItem.Close();
- }
+ _appBarItem?.Close();
if (_handler != null)
{