From 7689f77fe2f356d17a5ad59dbeb4a0fed3ca4a0d Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 25 May 2020 17:27:24 +0300 Subject: Added PPC power up sequence support ! Refactored AppBarItems implementation. --- .../Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs') 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().Pressed += (_, __) => + _appBarItem = NotificationProvider.PushAppBarItem(); + _appBarItem.Pressed += (_, __) => { - NotificationProvider.CurrentAppBarItem.Close(); + _appBarItem?.Close(); NavigationManager.NavigateTo(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) { -- cgit v1.3.1