maui
maui copied to clipboard
[Bug] No error when try push outside NavigationPage
Description
Steps to Reproduce
- Create a simple app, and make sure that
App.MainPageis anyContentPage - Create a button and implement a clicked event that does
Navigation.PushAsync() - Nothing happens
Expected Behavior
- See an exception or log that tells me that I need to have a
NavigationPageas the root page. - When
App.MainPagehas aNavigationPageas the root page I want the breakpoint, inside click event handler, triggers (as you can see in the video that doesn't happen).
Actual Behavior
Nothing happens
Basic Information
- Version with issue: preview 6 (?)
- Last known good version: Na
- IDE: VS 2022
- Platform Target Frameworks:
- iOS:
- Android:
- UWP:
- Android Support Library Version:
- Nuget Packages: Na
- Affected Devices: Android
Screenshots
https://user-images.githubusercontent.com/20712372/128791827-cc4f64e3-af88-4dfc-8544-ec79a1f63083.mp4
Reproduction Link
Workaround
Verified Repro with Android 11. Repro project is available: #2013.zip
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Hi @pictos. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Verified this issue with Visual Studio Enterprise 17.6.0 Preview 2.0. This issue repro on Android 13 with below Project:

This is still an issue. The bug is that we should throw an exception if you aren't wrapped with a navigationpage.
Thanks @PureWeen , I have updated the verify result in above comment.
@PureWeen what about such solution? https://github.com/dotnet/maui/pull/20155
Related PR https://github.com/dotnet/maui/pull/20155