From 6a57fbce8bf9931ecfd03c6e91f2fb25be4e7d9f Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 23 Aug 2018 10:23:17 +0300 Subject: Implemented new hardware components "Active" on machine operator upload hardware configuration. Improved and tested global exception trapper on async task. Fixed a weird issue on navigation control toAnimation complete's twice. --- .../Tango.SharedUI/Controls/NavigationControl.cs | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls') diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs index c8b6d3afb..d21a562fd 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs @@ -378,21 +378,28 @@ namespace Tango.SharedUI.Controls fromElement.Deactivate(!KeepElementsAttached); }; + bool completed = false; + toAnimation.Completed += (_, __) => { - INavigationView navigationView = toElement.Element as INavigationView; - if (navigationView != null) + if (!completed) { - navigationView.OnNavigated(); - } + completed = true; + + INavigationView navigationView = toElement.Element as INavigationView; + if (navigationView != null) + { + navigationView.OnNavigated(); + } - INavigationViewModel fromVM = fromElement.Element.DataContext as INavigationViewModel; - INavigationViewModel toVM = toElement.Element.DataContext as INavigationViewModel; + INavigationViewModel fromVM = fromElement.Element.DataContext as INavigationViewModel; + INavigationViewModel toVM = toElement.Element.DataContext as INavigationViewModel; - if (fromVM != null && fromVM != toVM) fromVM.OnNavigatedFrom(); - if (toVM != null) toVM.OnNavigatedTo(); + if (fromVM != null && fromVM != toVM) fromVM.OnNavigatedFrom(); + if (toVM != null) toVM.OnNavigatedTo(); - _onCompleted?.Invoke(); + _onCompleted?.Invoke(); + } }; switch (TransitionType) -- cgit v1.3.1