diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-11-21 12:14:55 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-11-21 12:14:55 +0200 |
| commit | 8de9762343d53469f493e5ead81e37d575f3f6d9 (patch) | |
| tree | 38bc8f29ada92081a2267c4fa0ef147f0e8df784 /Software/Visual_Studio/PPC/Tango.PPC.UI | |
| parent | 94c88e6e337be52b77ce3debf56ca09e7d80b2b6 (diff) | |
| download | Tango-8de9762343d53469f493e5ead81e37d575f3f6d9.tar.gz Tango-8de9762343d53469f493e5ead81e37d575f3f6d9.zip | |
Refactored PPC Navigation "OnNavigatedFrom/To" to be called from the navigation manager instead of NavigationControl.
Fixed issue with PPC job progress app bar item not visible in some cases.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs | 30 |
1 files changed, 29 insertions, 1 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 fe3cabcc1..a0338912f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs @@ -202,6 +202,8 @@ namespace Tango.PPC.UI.Navigation } } + + if (pushToHistory && _lastFullPath != null && !_preventHistory) { _navigationHistory.Push(_lastFullPath); @@ -228,7 +230,19 @@ namespace Tango.PPC.UI.Navigation foreach (var view in path.Skip(1)) { await Task.Delay(100); - var v = moduleNavigation.NavigateTo(view); + + var v = moduleNavigation.NavigateTo(view, () => + { + if (fromVM is PPCViewModel) + { + (fromVM as PPCViewModel)?.OnNavigatedFrom(); + } + + if (_currentVM is PPCViewModel) + { + (_currentVM as PPCViewModel)?.OnNavigatedTo(); + } + }); if (v != null) { @@ -253,6 +267,20 @@ namespace Tango.PPC.UI.Navigation NavigationCycleCompleted?.Invoke(fromVM, _currentVM); } } + else + { + await Task.Delay(500); + + if (fromVM is PPCViewModel) + { + (fromVM as PPCViewModel)?.OnNavigatedFrom(); + } + + if (_currentVM is PPCViewModel) + { + (_currentVM as PPCViewModel)?.OnNavigatedTo(); + } + } return true; } |
