You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Frame.Navigated and page's OnNavigatedTo fire in a different order on android than on uwp. #1863
difficulty/starter 🚀Categorizes an issue for which the difficulty level is reachable by newcomerskind/bugSomething isn't workingplatform/android 🤖Categorizes an issue or PR as relevant to the Android platformproject/navigation-lifecycle 🧬Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...)
On uwp the Frame.Navigated event fires before OnNavigatedTo. On android they fire in the other order.
This was the cause of a difficult to track down bug in our project as we relied on setup that was done in the Frame Navigated event during the OnNavigatedTo page override. We can currently work around this issue by using some messy conditional compilation but this issue makes it difficult to port existing apps from uwp.
Expected behavior
For Frame Navigated to fire before OnNavigatedTo on android.
How to reproduce it (as minimally and precisely as possible)
Run the sample project. NavTest.zip
Notice that in the debug log "Frame Navigated" and "OnNavigatedTo" are printed in a different order on android than uwp.
Environment
Affected platform(s):
iOS
Android
WebAssembly
WebAssembly renderers for Xamarin.Forms
Windows
Build tasks
Solution Templates
Visual Studio:
2019 (version: 16.3.5)
Relevant plugins:
Uno Platform Solution Templates - 1.45.0.1865
@jeromelaban I just confirmed on iOS that the problem is even more widespread: .Loading and .Loaded is fired before .OnNavigatedTo which is wrong: on UWP they are fired after.
This raises a serious problem: with NavigationEventArgs in .OnNavigatedTo I'm supposed to pass "parameters" to the new frame. I needed those "parameters" when processing .Loading and/or .Loaded. What workaround would there be available.
@DierkDroth yes we are aware of this one - #2872 and #2895. It is however quite complex issue, so it will require quite a bit of work across all platforms
changed the title [-]Frame.Navigated and page's OnNavigatedTo fire in a different order on android than on uwp.[/-][+]`Frame.Navigated` and page's `OnNavigatedTo` fire in a different order on android than on uwp.[/+]on Jun 2, 2023
difficulty/starter 🚀Categorizes an issue for which the difficulty level is reachable by newcomerskind/bugSomething isn't workingplatform/android 🤖Categorizes an issue or PR as relevant to the Android platformproject/navigation-lifecycle 🧬Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...)
Activity
MartinZikmund commentedon Oct 16, 2019
I will have look at this
MartinZikmund commentedon Oct 31, 2019
I let my brother do this one, so he can try developing on Uno as well 😀
jeromelaban commentedon Aug 31, 2020
Closing as a duplicate of #1863
4 remaining items
DierkDroth commentedon Oct 14, 2020
@jeromelaban I just confirmed on iOS that the problem is even more widespread: .Loading and .Loaded is fired before .OnNavigatedTo which is wrong: on UWP they are fired after.
This raises a serious problem: with NavigationEventArgs in .OnNavigatedTo I'm supposed to pass "parameters" to the new frame. I needed those "parameters" when processing .Loading and/or .Loaded. What workaround would there be available.
BTW: believe the same problem exists on WASM
MartinZikmund commentedon Oct 14, 2020
@DierkDroth yes we are aware of this one - #2872 and #2895. It is however quite complex issue, so it will require quite a bit of work across all platforms
[-]Frame.Navigated and page's OnNavigatedTo fire in a different order on android than on uwp.[/-][+]`Frame.Navigated` and page's `OnNavigatedTo` fire in a different order on android than on uwp.[/+]MartinZikmund commentedon Jun 2, 2023
This part of navigation lifecycle was adjusted in #9251
Merge pull request #1863 from unoplatform/dev/jela/checkbox-dc