aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
diff options
context:
space:
mode:
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.cs70
1 files changed, 67 insertions, 3 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 52f0fb403..9e8a9fe34 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
@@ -38,7 +38,15 @@ namespace Tango.PPC.UI.ViewModels
public bool IsMenuOpened
{
get { return _isMenuOpened; }
- set { _isMenuOpened = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _isMenuOpened = value; RaisePropertyChangedAuto();
+
+ if (!_isMenuOpened)
+ {
+ IsPowerOpened = false;
+ }
+ }
}
private bool _isNotificationsOpened;
@@ -48,7 +56,20 @@ namespace Tango.PPC.UI.ViewModels
public bool IsNotificationsOpened
{
get { return _isNotificationsOpened; }
- set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); }
+ set
+ {
+ _isNotificationsOpened = value; RaisePropertyChangedAuto();
+ }
+ }
+
+ private bool _isPowerOpened;
+ /// <summary>
+ /// Gets or sets a value indicating whether the power area is opened.
+ /// </summary>
+ public bool IsPowerOpened
+ {
+ get { return _isPowerOpened; }
+ set { _isPowerOpened = value; RaisePropertyChangedAuto(); }
}
#endregion
@@ -90,6 +111,16 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
public RelayCommand UpdateCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the power command.
+ /// </summary>
+ public RelayCommand PowerCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the restart application command.
+ /// </summary>
+ public RelayCommand RestartApplicationCommand { get; set; }
+
#endregion
#region Constructors
@@ -106,12 +137,15 @@ namespace Tango.PPC.UI.ViewModels
StopPrintingCommand = new RelayCommand(StopPrinting);
SignOutCommand = new RelayCommand(SignOut);
- UpdateCommand = new RelayCommand(() =>
+ UpdateCommand = new RelayCommand(() =>
{
NavigationManager.NavigateTo(NavigationView.MachineUpdateView);
TangoIOC.Default.GetInstance<MachineUpdateViewVM>().CheckForUpdates();
IsMenuOpened = false;
});
+
+ PowerCommand = new RelayCommand(() => IsPowerOpened = true);
+ RestartApplicationCommand = new RelayCommand(RestartApplication);
}
#endregion
@@ -194,6 +228,17 @@ namespace Tango.PPC.UI.ViewModels
}
}
+ /// <summary>
+ /// Restarts the application.
+ /// </summary>
+ private async void RestartApplication()
+ {
+ if (await NotificationProvider.ShowQuestion("Are you sure you want to restart the application?"))
+ {
+ ApplicationManager.Restart();
+ }
+ }
+
#endregion
#region Override Methods
@@ -217,6 +262,25 @@ namespace Tango.PPC.UI.ViewModels
#endregion
+ #region Public Methods
+
+ /// <summary>
+ /// Toggles the application technician mode.
+ /// </summary>
+ public void ToggleTechnicianMode()
+ {
+ if (!ApplicationManager.IsInTechnicianMode)
+ {
+ ApplicationManager.EnterTechnicianMode();
+ }
+ else
+ {
+ ApplicationManager.ExitTechnicianMode();
+ }
+ }
+
+ #endregion
+
#region Event Handlers
/// <summary>