From 5ef0db61993e269caa1d1184ee0be2ae1c6ea393 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 15 Dec 2019 19:44:35 +0200 Subject: Implemented power down by user and from embedded button. --- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index e18354f89..d7717e6db 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -246,10 +246,23 @@ namespace Tango.PPC.UI.ViewModels } } + /// + /// Powers off the machine. + /// private async void PowerOffMachine() { IsMenuOpened = false; - await NavigationManager.NavigateTo(nameof(PowerOffView)); + if (await NotificationProvider.ShowQuestion("Are you sure you wish to turn off the machine?")) + { + try + { + await MachineProvider.MachineOperator.PowerDown(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error triggering power down."); + } + } } #endregion -- cgit v1.3.1