diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-07-22 17:32:49 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-07-22 17:32:49 +0300 |
| commit | 449cc62b5bd91e5233edc5c0042d5792c8aa2972 (patch) | |
| tree | 45b5b82f9300bf81da6930523817fac2f809717b /Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs | |
| parent | 8f082608ed86c6027cb88539d40d005189fa1cf6 (diff) | |
| download | Tango-449cc62b5bd91e5233edc5c0042d5792c8aa2972.tar.gz Tango-449cc62b5bd91e5233edc5c0042d5792c8aa2972.zip | |
Added job outline logs to machine operator.
Fixed navigation button disabled on PPC.
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.cs | 25 |
1 files changed, 22 insertions, 3 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 7c71ef3d0..8d3618fee 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs @@ -203,12 +203,15 @@ namespace Tango.PPC.UI.Navigation { try { + IsNavigating = true; + String[] path = fullPath.Split('.'); var module = _moduleLoader.UserModules.SingleOrDefault(x => x.GetType().Name == path[0] || x.Name == path[0]); if (module == null) { await _notificationProvider.ShowError("The specified module was not loaded."); + IsNavigating = false; return false; } @@ -224,6 +227,7 @@ namespace Tango.PPC.UI.Navigation { if (!await (_currentVM as INavigationBlocker).OnNavigateBackRequest()) { + IsNavigating = false; return false; } } @@ -231,6 +235,7 @@ namespace Tango.PPC.UI.Navigation { if (!await (_currentVM as INavigationBlocker).OnNavigateOutRequest()) { + IsNavigating = false; return false; } } @@ -334,6 +339,8 @@ namespace Tango.PPC.UI.Navigation } catch (Exception ex) { + IsNavigating = false; + LogManager.Log(ex, $"Error navigating to '{fullPath}'."); await _notificationProvider.ShowError($"Error navigating to '{fullPath}'."); return false; } @@ -430,6 +437,20 @@ namespace Tango.PPC.UI.Navigation set { _isBackEnabled = value; RaisePropertyChangedAuto(); } } + private bool _isNavigating; + /// <summary> + /// Gets or sets a value indicating whether the navigation system is currently navigating. + /// </summary> + public bool IsNavigating + { + get { return _isNavigating; } + set + { + _isNavigating = value; + RaisePropertyChangedAuto(); + } + } + /// <summary> /// Navigates to the previous view if <see cref="P:Tango.PPC.Common.Navigation.INavigationManager.CanNavigateBack" /> is true. /// </summary> @@ -502,8 +523,6 @@ namespace Tango.PPC.UI.Navigation private void NotifyOnBeforeNavigated(object fromVM, object toVM) { - IsBackEnabled = false; - if (fromVM == toVM) return; if (fromVM is PPCViewModel) @@ -519,7 +538,7 @@ namespace Tango.PPC.UI.Navigation private void NotifyOnNavigated(object fromVM, object toVM) { - IsBackEnabled = true; + IsNavigating = false; if (fromVM == toVM) return; |
