aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
index a4f550a39..01a47539e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using System.Windows.Threading;
using Tango.Core.DI;
using Tango.Integration.ExternalBridge;
+using Tango.Integration.Operation;
using Tango.PPC.Common;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Authentication;
@@ -14,6 +15,7 @@ using Tango.PPC.Common.Modules;
using Tango.PPC.Common.Navigation;
using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.WatchDog;
+using Tango.PPC.UI.Dialogs;
using Tango.SharedUI;
namespace Tango.PPC.UI.ViewModels
@@ -49,6 +51,13 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
public override void OnApplicationStarted()
{
+
+ }
+
+ public override void OnApplicationReady()
+ {
+ base.OnApplicationReady();
+ MachineProvider.MachineOperator.CartridgeValidationRequestReceived += MachineOperator_CartridgeValidationRequestReceived;
}
#region Event Handlers
@@ -63,6 +72,26 @@ namespace Tango.PPC.UI.ViewModels
CurrentDateTime = DateTime.Now;
}
+ private void MachineOperator_CartridgeValidationRequestReceived(object sender, CartridgeValidationEventArgs e)
+ {
+ InvokeUI(async () =>
+ {
+ var vm = await NotificationProvider.ShowDialog<CartridgeValidationViewVM>(new CartridgeValidationViewVM()
+ {
+ IDSPacks = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.ToList(),
+ });
+
+ if (vm.DialogResult)
+ {
+ e.Approve(vm.SelectedIDSPack.PackIndex);
+ }
+ else
+ {
+ e.Decline();
+ }
+ });
+ }
+
#endregion
}
}