-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NavigationFrom not called when navigate to different Hamburger Menu Page #1353
Comments
Please provide a sample that reproduces this issue. |
Just open a HamburgerMenu Prism Sample and update to the latest version of Prism and Xamarin Forms. Override OnNavigatedFrom method in ViewAViewModel, ViewBViewModel and ViewCViewModel and put breakpoints.
My case:
I wanted to use OnNavigatedFrom to save state of the working object on ViewA. I have similar cases related with going app to the background or re-launch app when you hit Android notification panel (Foreground service) and those cases works. Internal navigation doesn't worked as expected because of this bug. Updated sample in the attachment |
Verified. Thanks for submitting this. |
Super. Big thanks for this fix. |
You can get it now in the latest CI builds on MyGet. We have some pretty large efforts going on right now regarding aligning Prism across platforms, so I don't have a timeframe for the next preview. |
You surprised me with this MyGet. I used to not looking into this 'Packages source'. For most cases, nuget.org is enough. I would love to work with company where they have at least in 50% organized development process like you have for Prism. Congratulations. |
Still does not work. Checked with 7.1.0.123-pre (it supposed to be fixed according to it's release notes). Checked on Android only. Here is the sample project. |
It works just fine. You aren't setting the useModalNavigation parameter to true. |
Why should I set useModalNavigation parameter to true - I am not creating a modal page. However, when I changed second line to following, OnNavigationFrom started to be called: |
Because you can't set the Detail of a MasterDetail to another MasterDetailPage. Therefore you must push it modally. Looks like you have it figured out. |
I have similar problem with my app. When I'm on BasePage and I want to navigate from MasterDetailPage to some page (ViewA or ViewB), the OnNavigatedFrom method from BasePage not called. I tried to set useModalNavigation to true, but still doesn't work. Prism: 7.0.0.396 So, I created test app. @brianlagunas , I will be grateful for your help. |
@SeRgI1982 I pulled down your HamburgerMenu.zip file and updated the Prism libraries to version 7.1.0.431 and tried it out on iOS. If I switch from ViewA to ViewB the OnNavigatedFrom method is called on the MainPage but not on ViewA. Is this how it should behave or should OnNavigatedFrom be called on ViewA? @brianlagunas Could you confirm what Prism should be doing? When I navigate from ViewA to ViewB using an menu item on the MainPage, should the OnNavigatedFrom method be called on ViewA? Or on MainPage? Or both? Thanks! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
NavigationFrom is not called when navigating to a different Page related with menu item in HamburgerMenu (MasterDetail scenario).
Steps to Reproduce
All pages have ViewModels with INavigationAware implementation.
All ViewModels call OnNavigatedTo method when user navigates to them.
Create MasterDetail Page with MenuPage as a Master.
MenuPage has two buttons:
PageA is a default page (after openning the app, user landing on PageA)
Open MenuPage and hit btn2
Expected Behavior
PageAViewModel.OnNavigatedFrom - should be executed,
PageBViewModel.OnNavigatedTo - should be executed.
Actual Behavior
PageAViewModel.OnNavigatedFrom - is not executed,
PageBViewModel.OnNavigatedTo - is executed.
Basic Information
The text was updated successfully, but these errors were encountered: