From 61a68af94273563e1179b49062ac96b8a627a72a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 14 Jun 2018 17:32:09 +0300 Subject: Working on PPC. --- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) (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 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; + /// + /// Gets or sets a value indicating whether the side menu is opened. + /// + public bool IsMenuOpened + { + get { return _isMenuOpened; } + set { _isMenuOpened = value; RaisePropertyChangedAuto(); } + } + + /// + /// Gets or sets the module navigation command. + /// + public RelayCommand ModuleNavigationCommand { get; set; } + + /// + /// Gets or sets the home command. + /// + public RelayCommand HomeCommand { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public LayoutViewVM() + { + ModuleNavigationCommand = new RelayCommand(HandleModuleNavigationCommand); + HomeCommand = new RelayCommand(HandleHomeCommand); + } + + /// + /// Handles the module navigation command. + /// + /// Name of the module. + private void HandleModuleNavigationCommand(string moduleName) + { + IsMenuOpened = false; + NavigationManager.NavigateTo(moduleName); + } + + /// + /// Handles the home command. + /// + private void HandleHomeCommand() + { + IsMenuOpened = false; + NavigationManager.NavigateTo(NavigationView.HomeModule); + } + /// /// Called when the application has been started. /// -- cgit v1.3.1