diff options
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 | 37 |
1 files changed, 22 insertions, 15 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 eee37b2e0..efe8149f6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs @@ -213,30 +213,37 @@ namespace Tango.PPC.UI.Navigation { var moduleNavigation = moduleView.FindChildOffline<NavigationControl>(); - moduleNavigation.RegisterForLoadedOrNow(async (x, e) => + if (moduleNavigation != null) { - foreach (var view in path.Skip(1)) + moduleNavigation.RegisterForLoadedOrNow(async (x, e) => { - await Task.Delay(100); - var v = moduleNavigation.NavigateTo(view); - - if (v != null) + foreach (var view in path.Skip(1)) { - _currentVM = v.DataContext; + await Task.Delay(100); + var v = moduleNavigation.NavigateTo(view); - if (view != path.Last()) + if (v != null) { - moduleNavigation = v.FindChildOffline<NavigationControl>(); + _currentVM = v.DataContext; + + if (view != path.Last()) + { + moduleNavigation = v.FindChildOffline<NavigationControl>(); + } + } + else + { + throw LogManager.Log(new ArgumentNullException("Could not navigate to " + fullPath)); } } - else - { - throw LogManager.Log(new ArgumentNullException("Could not navigate to " + fullPath)); - } - } + NavigationCycleCompleted?.Invoke(fromVM, _currentVM); + }); + } + else + { NavigationCycleCompleted?.Invoke(fromVM, _currentVM); - }); + } } return true; |
