diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-14 17:32:09 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-14 17:32:09 +0300 |
| commit | 61a68af94273563e1179b49062ac96b8a627a72a (patch) | |
| tree | b435c82b2046ece012b3555afa77c660f0a2b0ca /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | |
| parent | 580cb401e8b31501cb3fbee1b9f59a67ad636633 (diff) | |
| download | Tango-61a68af94273563e1179b49062ac96b8a627a72a.tar.gz Tango-61a68af94273563e1179b49062ac96b8a627a72a.zip | |
Working on PPC.
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 | 50 |
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> |
