diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-22 11:58:11 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-22 11:58:11 +0300 |
| commit | 0c97dba8c1443ee39029136c52bc3861702888e2 (patch) | |
| tree | 0eba2c6e9a170bb316045f67add60060734d4f0d /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs | |
| parent | 884fce5075ca6a53cb5687feb0b01c6db0802f06 (diff) | |
| download | Tango-0c97dba8c1443ee39029136c52bc3861702888e2.tar.gz Tango-0c97dba8c1443ee39029136c52bc3861702888e2.zip | |
Added cartridge insertion validation handling.
Implemented a better keep alive mechanism.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs | 29 |
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 } } |
