aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-11-25 16:39:01 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-11-25 16:39:01 +0200
commit78c93e2ee1eddff67554edec9f956536a0b61482 (patch)
tree208e8f9c368cfa324e255493bb287e50b79b04fa /Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation
parentca18248f6203d7567a2276ec76360aedd4cfda0b (diff)
downloadTango-78c93e2ee1eddff67554edec9f956536a0b61482.tar.gz
Tango-78c93e2ee1eddff67554edec9f956536a0b61482.zip
Working on Backup/Restore...
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs55
1 files changed, 35 insertions, 20 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 77b09f638..fe4be700c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs
@@ -117,22 +117,22 @@ namespace Tango.PPC.UI.Navigation
var fromView = MainView.Instance.NavigationControl.SelectedElement;
FrameworkElement toView = null;
- toView = MainView.Instance.NavigationControl.NavigateTo(view.ToString(),() =>
- {
- var fromVM = toView.DataContext as PPCViewModel;
+ toView = MainView.Instance.NavigationControl.NavigateTo(view.ToString(), () =>
+ {
+ var fromVM = toView.DataContext as PPCViewModel;
- if (fromVM != null)
- {
- fromVM.OnNavigatedFrom();
- }
+ if (fromVM != null)
+ {
+ fromVM.OnNavigatedFrom();
+ }
- var toVM = toView.DataContext as PPCViewModel;
+ var toVM = toView.DataContext as PPCViewModel;
- if (toVM != null)
- {
- toVM.OnNavigatedTo();
- }
- });
+ if (toVM != null)
+ {
+ toVM.OnNavigatedTo();
+ }
+ });
return Task.FromResult(true);
}
@@ -251,16 +251,19 @@ namespace Tango.PPC.UI.Navigation
{
await Task.Delay(100);
- var v = moduleNavigation.NavigateTo(view, () =>
+ FrameworkElement v = null;
+
+ v = moduleNavigation.NavigateTo(view, () =>
{
- if (fromVM is PPCViewModel)
+ if (v != null)
{
- (fromVM as PPCViewModel)?.OnNavigatedFrom();
- }
+ var toVM = v.DataContext as PPCViewModel;
- if (_currentVM is PPCViewModel)
- {
- (_currentVM as PPCViewModel)?.OnNavigatedTo();
+ if (toVM != null)
+ {
+ (fromVM as PPCViewModel)?.OnNavigatedFrom();
+ (toVM as PPCViewModel)?.OnNavigatedTo();
+ }
}
});
@@ -284,6 +287,18 @@ namespace Tango.PPC.UI.Navigation
}
else
{
+ await Task.Delay(500);
+
+ if (fromVM is PPCViewModel)
+ {
+ (fromVM as PPCViewModel)?.OnNavigatedFrom();
+ }
+
+ if (_currentVM is PPCViewModel)
+ {
+ (_currentVM as PPCViewModel)?.OnNavigatedTo();
+ }
+
NavigationCycleCompleted?.Invoke(fromVM, _currentVM);
}
}