Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

Users reported confusion about where navigation code examples should be placed, since the documentation showed standalone await Navigation.PushAsync(...) calls without context—and constructors can't be async.

Changes

  • Wrapped navigation code examples in button click event handlers to show typical usage:
    async void OnNavigateButtonClicked(object sender, EventArgs e)
    {
        await Navigation.PushAsync(new DetailsPage());
    }
  • Added explicit note that Navigation property is available on any Page-derived type
  • Applied to all four navigation sections: push/pop for both regular and modal stacks
Original prompt

This section details on the original issue you should resolve

<issue_title>Context seems to be missing</issue_title>
<issue_description>While reading this page and seeing the examples it is hard to understand the context of the examples. It will say "A page can be modally navigated to by calling the PushModalAsync method on the Navigation property of the current page:" then shows a code example and explains what that code did.

But the constructor of a page is not asynchronous and cannot await methods. So that leaves me unsure as to where this code goes. If the example showed the class with this code in it then I would understand how to use it.

Also it speaks to the "Navigation Property" of the current page. Does each page I create have a navigation property or do I need to add one.

I feel like there is another document I should have read before reading this one but can't find it referenced here.

I was able to understand the root page example as it shows the app class cs file and where the code would go.

I'm certain the explanation is spot on I just don't understand the context so i'm confused.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@learn-build-service-prod
Copy link

Learn Build status updates of commit bc4164a:

✅ Validation status: passed

For more details, please refer to the build report.

- Updated navigation code examples to show them within button click event handlers
- Added explanation that Navigation property is available on any Page-derived type
- Provides clearer context for where navigation code should be placed
- Updated ms.date to reflect the changes

Co-authored-by: PureWeen <[email protected]>
@learn-build-service-prod
Copy link

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod
Copy link

Learn Build status updates of commit 0f34db2:

✅ Validation status: passed

File Status Preview URL Details
docs/user-interface/pages/navigationpage.md ✅Succeeded View (>=net-maui-8.0)

For more details, please refer to the build report.

@learn-build-service-prod
Copy link

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

Copilot AI changed the title [WIP] Add context to navigation examples for clarity Add contextual examples to NavigationPage documentation Nov 28, 2025
Copilot AI requested a review from PureWeen November 28, 2025 23:12
@learn-build-service-prod
Copy link

Learn Build status updates of commit 0f34db2:

✅ Validation status: passed

File Status Preview URL Details
docs/user-interface/pages/navigationpage.md ✅Succeeded View (>=net-maui-8.0)

For more details, please refer to the build report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context seems to be missing

2 participants