Skip to content

Document TryShowPopupAsync, TryClosePopupAsync and PopupResultOrException - #685

Draft
Brandon Minnick (TheCodeTraveler) wants to merge 4 commits into
MicrosoftDocs:mainfrom
TheCodeTraveler:docs/pr-3244
Draft

Brandon Minnick (TheCodeTraveler) wants to merge 4 commits into
MicrosoftDocs:mainfrom
TheCodeTraveler:docs/pr-3244

Conversation

@TheCodeTraveler

Copy link
Copy Markdown
Contributor

Documents TryShowPopupAsync and TryClosePopupAsync from CommunityToolkit/Maui#3244. They return the C# 15 union PopupResultOrException instead of throwing.

This PR stays a draft until the toolkit release that ships CommunityToolkit/Maui#3244 is published.

  • Popup.md:
    • New section "Showing and closing a Popup without exceptions": every Try overload, an exhaustive switch, what comes back for each failure, and the .Value switch for C# versions before 15.
    • New "Closing on the INavigation you pass", the breaking change in Add TryShowPopupAsync and TryClosePopupAsync CommunityToolkit/Maui#3244: ClosePopupAsync no longer falls back to Shell.Current.
  • popup-service.md: the IPopupService Try extension methods, with an example.
  • popup-result.md: corrects the note about Result when a popup is dismissed (it throws InvalidCastException for a non-nullable value type) and links to the Try methods.

Overlaps #667 in Popup.md and popup-result.md; whichever merges second needs a small merge.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xample, scope the OnDisappearing note to TryShowPopupAsync, move the INavigation close note under Closing a Popup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion cases, InvalidCastException for dismissed Result, canceled-token and derived-type wording

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Learn Build status updates of commit daf4f5b:

✅ Validation status: passed

File Status Preview URL Details
docs/maui/views/popup-service.md ✅Succeeded View
docs/maui/views/Popup.md ✅Succeeded View
docs/maui/views/popup/popup-result.md ✅Succeeded View

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.

1 participant