question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OnNavigatedTo is not called when navigating from a specific page

See original GitHub issue

Description

OnNavigatedTo on MapsUIPage.cs is never called when visiting from MapPage.cs via Shell navigation and always called when visiting from all other pages.

Reproduction project: AndroidBluetoothBeaconTest.zip

Steps to Reproduce

  1. run app
  2. click MAUI Map item in menu
  3. click MapsUI Map item in menu - OnNavigatedTo is not called when visiting from that MAUI Map page (MapPage.xaml)

Reproduction video (the breakpoint should be triggered on every navigation to the page but was only triggered when navigating from the “Scan bluetooth devices” page).

https://user-images.githubusercontent.com/64279914/225779499-2bf4d83a-929c-4666-87cd-f2f287aa609b.mp4

Version with bug

7.0 (current)

Last version that worked well

7.0 (current)

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 12

Did you find any workaround?

no

Relevant log output

No response

Issue Analytics

  • State:open
  • Created 6 months ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
drasticactionscommented, Mar 17, 2023
image

You have the same route registered twice for different pages. Change the route name for the pages and it should work.

@PureWeen Is this normally allowed? Should it throw if you try and register the same path for different pages?

0reactions
Zhanglirong-Winniecommented, Jun 20, 2023

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on android platform with sample project. Android.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

xamarin.forms - OnNavigatedTo is not called when using ...
I believe this is a bug, or at least an oversight in the API. It does call OnNavigatedTo , but only on the...
Read more >
(Prism) Why does Navigation not work in OnNavigatedTo ...
Login button navigates as normal to Home page. However Login page should actually be skipped as OnNavigatedTo has Navigate to Home code. Top ......
Read more >
Page.OnNavigatedFrom(NavigationEventArgs) Method
OnNavigatedFrom is invoked by default when you navigate between pages in your app. You can override this method and get info about the...
Read more >
Windows 8.1 Apps with XAML and C# Unleashed
When you navigate to a Page by calling Navigate, you get a new instance of it, regardless of NavigationCacheMode. No special relationship exists...
Read more >
Learning .NET MAUI: Unlock the potential of .NET MAUI for ...
InsertPageBefore method inserts a specified page in the navigation stack ... and has been navigated to the HomePage , the LoginPage is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found