From 9277bbd2fa070c69b83904f8fe5628fab2b947b8 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 25 Nov 2018 17:52:49 +0200 Subject: Working on job export import to storage. --- .../Navigation/DefaultNavigationManager.cs | 37 +++++++++++++--------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation') 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(); - 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(); + _currentVM = v.DataContext; + + if (view != path.Last()) + { + moduleNavigation = v.FindChildOffline(); + } + } + 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; -- cgit v1.3.1