diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-15 19:44:35 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-15 19:44:35 +0200 |
| commit | 5ef0db61993e269caa1d1184ee0be2ae1c6ea393 (patch) | |
| tree | 395e07d0140b233e4d40fd0b5d037e0a01e75c27 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | |
| parent | d92af8452acdde8595e16c379e8a17cd5d3efdbe (diff) | |
| download | Tango-5ef0db61993e269caa1d1184ee0be2ae1c6ea393.tar.gz Tango-5ef0db61993e269caa1d1184ee0be2ae1c6ea393.zip | |
Implemented power down by user and from embedded button.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 15 |
1 files changed, 14 insertions, 1 deletions
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 } } + /// <summary> + /// Powers off the machine. + /// </summary> private async void PowerOffMachine() { IsMenuOpened = false; - await NavigationManager.NavigateTo<InternalModule>(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 |
