aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-14 19:23:02 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-14 19:23:02 +0300
commit5224c29724a65ba10901053b23840d299826a6a8 (patch)
treedcdc2ff1a6384c7d816b1ab9055bf7c7d948e039 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
parent61a68af94273563e1179b49062ac96b8a627a72a (diff)
downloadTango-5224c29724a65ba10901053b23840d299826a6a8.tar.gz
Tango-5224c29724a65ba10901053b23840d299826a6a8.zip
Working on PPC navigation history!
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.cs29
1 files changed, 25 insertions, 4 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 8731bc7d9..99841516e 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
@@ -41,6 +41,11 @@ namespace Tango.PPC.UI.ViewModels
public RelayCommand<String> ModuleNavigationCommand { get; set; }
/// <summary>
+ /// Gets or sets the menu or back command.
+ /// </summary>
+ public RelayCommand MenuOrBackCommand { get; set; }
+
+ /// <summary>
/// Gets or sets the home command.
/// </summary>
public RelayCommand HomeCommand { get; set; }
@@ -50,15 +55,31 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
public LayoutViewVM()
{
- ModuleNavigationCommand = new RelayCommand<string>(HandleModuleNavigationCommand);
- HomeCommand = new RelayCommand(HandleHomeCommand);
+ ModuleNavigationCommand = new RelayCommand<string>(NavigateToModule);
+ HomeCommand = new RelayCommand(NavigateHome);
+ MenuOrBackCommand = new RelayCommand(OpenMenuOrNavigateBack);
+ }
+
+ /// <summary>
+ /// Opens the menu or navigate back.
+ /// </summary>
+ private void OpenMenuOrNavigateBack()
+ {
+ if (NavigationManager.CanNavigateBack)
+ {
+ NavigationManager.NavigateBack();
+ }
+ else
+ {
+ IsMenuOpened = true;
+ }
}
/// <summary>
/// Handles the module navigation command.
/// </summary>
/// <param name="moduleName">Name of the module.</param>
- private void HandleModuleNavigationCommand(string moduleName)
+ private void NavigateToModule(string moduleName)
{
IsMenuOpened = false;
NavigationManager.NavigateTo(moduleName);
@@ -67,7 +88,7 @@ namespace Tango.PPC.UI.ViewModels
/// <summary>
/// Handles the home command.
/// </summary>
- private void HandleHomeCommand()
+ private void NavigateHome()
{
IsMenuOpened = false;
NavigationManager.NavigateTo(NavigationView.HomeModule);