In my .NET MAUI App, I navigate to one of my ContentPages via:
await Shell.Current.GoToAsync(nameof(ManagePeopleItem), true);
The page is registered in AppShell.xaml.cs via:
Routing.RegisterRoute(nameof(ManagePeopleItem), typeof(ManagePeopleItem));
So, when I display this Page, I can see the Back Button "<-" in my Navigation Bar. But when I click this Button and override "OnBackButtonPressed()" this Code is never reached. I also tried to override it in AppShell.xaml.cs, but it is also not fired there.
What am I doing wrong?
I tested the code you provided. And it shows the same situation happened to you.
I searched relevant cases about it. Finally I found this: On Screen Back Button Does Not Fire OnBackButtonPressed in Android on GitHub. When you run it on Windows instead of Android, OnBackButtonPressed-Event can be reached. But for Android, it can't. You can follow up this issue.