-
-
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
[XF] Deep linking within a NavigationPage results in an incorrect ContentPage Title on Android #765
Comments
Thanks for reporting this. As it turns out this is not an issue with Prism, but rather a bug in Xamarin Forms. I have submitted this bug to Xamarin and you can follow the status here: |
Thanks for the quick response and the bugzilla link. You're the man! |
In case you were not aware: I just noticed that when I do deep navigation with a root navigation page, the order in which the Pushed event on the navigation page is firing (and thus the CurrentPage property is set) is being reverted. So if my stack is: HomePage -> FooPage -> FooDetailsPage I end up with the following event order: 1: Pushed: FooDetailsPage (is NavigationPage.CurrentPage) Is this Xamarin, too? Let me know if I should post this onto the Bugzilla ticket you created. |
@hardcodet This is a known issue and has already been reported to Xamarin |
Any ideas how to overcome this until the bug is fixed? |
The only work-around is don't deep link |
Deep linking is kinda mandatory for me ... I have companies that are connected to other companies, and so I have to go deep link if I do not want to fill my stack too much :-( Am I missing the point here, can I destroy pages until certain Uri and then build again or I have to go from root every time? |
Unfortunately, this is a bug that has not been fixed by Xamarin. You could try a trick to where you add INavigatonAware to the Page/ViewModel, and in the OnNavigatedTo of the Page to set the Title to the correct text. |
I see. Problem is it's not just title, the whole toolbar is shown from diferent page, in this case the MainPage. What do you think about poping the pages until SearchTab/SearchCompany and then pushing the new Company on the stack. This could result in pop animation for every page but still ... |
Worth a try. |
Fixed! |
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. |
Create a new Xamarin Forms Prism application
Make sure you have a few views included and add them to your dependency service (e.g. MainPage, ViewA, ViewB). In my case, I'm using XAML.
Provide a Title for your views (set the Title attribute in your XAML).
In your OnInitialized method for you PrismApplication, Deep link a few views deep inside of a NavigationPage.
NavigationService.NavigateAsync("NavigationPage/MainPage/ViewA/ViewB");
When starting this application the Visual Studio Emulator for Android, you will see that the final view is displayed, but the title is that of the first page after NavigationPage. In the example above, you will see ViewB, but the title will be the title of MainPage. Navigating back will show the titles correctly as you unwind the stack.
The text was updated successfully, but these errors were encountered: