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.cs50
1 files changed, 50 insertions, 0 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 4e200ada6..8731bc7d9 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
@@ -3,9 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.Core.Commands;
using Tango.Core.DI;
using Tango.PPC.Common;
using Tango.PPC.Common.Modules;
+using Tango.PPC.Common.Navigation;
using Tango.PPC.UI.ViewsContracts;
using Tango.SharedUI;
@@ -23,6 +25,54 @@ namespace Tango.PPC.UI.ViewModels
[TangoInject]
public IPPCModuleLoader ModuleLoader { get; set; }
+ private bool _isMenuOpened;
+ /// <summary>
+ /// Gets or sets a value indicating whether the side menu is opened.
+ /// </summary>
+ public bool IsMenuOpened
+ {
+ get { return _isMenuOpened; }
+ set { _isMenuOpened = value; RaisePropertyChangedAuto(); }
+ }
+
+ /// <summary>
+ /// Gets or sets the module navigation command.
+ /// </summary>
+ public RelayCommand<String> ModuleNavigationCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the home command.
+ /// </summary>
+ public RelayCommand HomeCommand { get; set; }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="LayoutViewVM"/> class.
+ /// </summary>
+ public LayoutViewVM()
+ {
+ ModuleNavigationCommand = new RelayCommand<string>(HandleModuleNavigationCommand);
+ HomeCommand = new RelayCommand(HandleHomeCommand);
+ }
+
+ /// <summary>
+ /// Handles the module navigation command.
+ /// </summary>
+ /// <param name="moduleName">Name of the module.</param>
+ private void HandleModuleNavigationCommand(string moduleName)
+ {
+ IsMenuOpened = false;
+ NavigationManager.NavigateTo(moduleName);
+ }
+
+ /// <summary>
+ /// Handles the home command.
+ /// </summary>
+ private void HandleHomeCommand()
+ {
+ IsMenuOpened = false;
+ NavigationManager.NavigateTo(NavigationView.HomeModule);
+ }
+
/// <summary>
/// Called when the application has been started.
/// </summary>