aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-27 14:18:38 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-27 14:18:38 +0300
commit0a7cebf17c66bb54e826d2b904d89c73e1c9a33b (patch)
treed72a7b3eb06162cf8f0119c09652d9d739916f9d /Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
parent2b9532cf665d8c8e53ea9c8908ae504963e86beb (diff)
downloadTango-0a7cebf17c66bb54e826d2b904d89c73e1c9a33b.tar.gz
Tango-0a7cebf17c66bb54e826d2b904d89c73e1c9a33b.zip
Working on PPC segments drag and drop.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs31
1 files changed, 17 insertions, 14 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
index befad6000..9e51d7252 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
@@ -64,7 +64,7 @@ namespace Tango.PPC.UI.Navigation
/// Navigates to the specified PPC view.
/// </summary>
/// <param name="view">The view.</param>
- public Task<bool> NavigateTo(NavigationView view)
+ public Task<bool> NavigateTo(NavigationView view, bool pushToHistory = true)
{
if (view == NavigationView.HomeModule)
{
@@ -75,11 +75,11 @@ namespace Tango.PPC.UI.Navigation
if (moduleAtt != null)
{
- return NavigateTo(firstModule.GetType(), moduleAtt.HomeViewName);
+ return NavigateTo(firstModule.GetType(), pushToHistory, moduleAtt.HomeViewName);
}
else
{
- return NavigateTo(firstModule.GetType());
+ return NavigateTo(firstModule.GetType(), pushToHistory);
}
}
else
@@ -93,7 +93,7 @@ namespace Tango.PPC.UI.Navigation
/// Navigates to the specified module.
/// </summary>
/// <typeparam name="T"></typeparam>
- public Task<bool> NavigateTo<T>() where T : IPPCModule
+ public Task<bool> NavigateTo<T>(bool pushToHistory = true) where T : IPPCModule
{
return NavigateTo(typeof(T));
}
@@ -103,9 +103,9 @@ namespace Tango.PPC.UI.Navigation
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="viewPath">The view path.</param>
- public Task<bool> NavigateTo<T>(string viewPath) where T : IPPCModule
+ public Task<bool> NavigateTo<T>(string viewPath, bool pushToHistory = true) where T : IPPCModule
{
- return NavigateTo<T>(viewPath.Split('.'));
+ return NavigateTo<T>(pushToHistory, viewPath.Split('.'));
}
/// <summary>
@@ -114,16 +114,16 @@ namespace Tango.PPC.UI.Navigation
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="viewPath">The view path.</param>
- public Task<bool> NavigateTo<T>(params String[] viewPath) where T : IPPCModule
+ public Task<bool> NavigateTo<T>(bool pushToHistory = true, params String[] viewPath) where T : IPPCModule
{
- return NavigateTo(typeof(T), viewPath);
+ return NavigateTo(typeof(T), pushToHistory, viewPath);
}
/// <summary>
/// Navigates to the specified module and view by full path (e.g Jobs.JobsView).
/// </summary>
/// <param name="fullPath">The full path.</param>
- public async Task<bool> NavigateTo(String fullPath)
+ public async Task<bool> NavigateTo(String fullPath, bool pushToHistory = true)
{
String[] path = fullPath.Split('.');
var module = _moduleLoader.UserModules.SingleOrDefault(x => x.GetType().Name == path[0] || x.Name == path[0]);
@@ -138,8 +138,11 @@ namespace Tango.PPC.UI.Navigation
}
}
- _navigationHistory.Push(fullPath);
- RaisePropertyChanged(nameof(CanNavigateBack));
+ if (pushToHistory)
+ {
+ _navigationHistory.Push(fullPath);
+ RaisePropertyChanged(nameof(CanNavigateBack));
+ }
MainView.Instance.NavigationControl.NavigateTo(NavigationView.LayoutView.ToString());
var navigationControl = LayoutView.Instance.NavigationControl;
@@ -172,15 +175,15 @@ namespace Tango.PPC.UI.Navigation
return true;
}
- private Task<bool> NavigateTo(Type moduleType, params String[] viewPath)
+ private Task<bool> NavigateTo(Type moduleType, bool pushToHistory = true, params String[] viewPath)
{
if (viewPath != null && viewPath.Length > 0)
{
- return NavigateTo(moduleType.Name + "." + String.Join(".", viewPath));
+ return NavigateTo(moduleType.Name + "." + String.Join(".", viewPath), pushToHistory);
}
else
{
- return NavigateTo(moduleType.Name);
+ return NavigateTo(moduleType.Name, pushToHistory);
}
}