diff --git a/.github/workflows/docs-from-code.lock.yml b/.github/workflows/docs-from-code.lock.yml index fc66a87464..0ed0fe948a 100644 --- a/.github/workflows/docs-from-code.lock.yml +++ b/.github/workflows/docs-from-code.lock.yml @@ -66,7 +66,7 @@ jobs: title: ${{ steps.sanitized.outputs.title }} steps: - name: Setup Scripts - uses: github/gh-aw/actions/setup@ffb8573262a0892a8117694ac8c0738e96e846d0 # v0.53.5 + uses: github/gh-aw/actions/setup@4d44d0e89851a877f4ddc0cb6c0197e42b1016c5 # v0.73.0 with: destination: /opt/gh-aw/actions - name: Generate agentic run info @@ -87,7 +87,7 @@ jobs: GH_AW_INFO_AWF_VERSION: "v0.23.0" GH_AW_INFO_AWMG_VERSION: "" GH_AW_INFO_FIREWALL_TYPE: "squid" - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { main } = require('/opt/gh-aw/actions/generate_aw_info.cjs'); @@ -107,7 +107,7 @@ jobs: fetch-depth: 1 persist-credentials: false - name: Check workflow file timestamps - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_WORKFLOW_FILE: "docs-from-code.lock.yml" with: @@ -118,7 +118,7 @@ jobs: await main(); - name: Compute current body text id: sanitized - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); @@ -192,7 +192,7 @@ jobs: GH_AW_PROMPT_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_EXPR_726AD1D2: ${{ github.event.issue.number || github.event.inputs.issue_number }} @@ -203,7 +203,7 @@ jobs: const { main } = require('/opt/gh-aw/actions/interpolate_prompt.cjs'); await main(); - name: Substitute placeholders - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_EXPR_726AD1D2: ${{ github.event.issue.number || github.event.inputs.issue_number }} @@ -249,7 +249,7 @@ jobs: run: bash /opt/gh-aw/actions/print_prompt_summary.sh - name: Upload activation artifact if: success() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: activation path: | @@ -285,7 +285,7 @@ jobs: output_types: ${{ steps.collect_output.outputs.output_types }} steps: - name: Setup Scripts - uses: github/gh-aw/actions/setup@ffb8573262a0892a8117694ac8c0738e96e846d0 # v0.53.5 + uses: github/gh-aw/actions/setup@4d44d0e89851a877f4ddc0cb6c0197e42b1016c5 # v0.73.0 with: destination: /opt/gh-aw/actions - name: Checkout repository @@ -310,7 +310,7 @@ jobs: id: checkout-pr if: | (github.event.pull_request) || (github.event.issue.pull_request) - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} with: @@ -326,7 +326,7 @@ jobs: run: bash /opt/gh-aw/actions/install_awf_binary.sh v0.23.0 - name: Determine automatic lockdown mode for GitHub MCP Server id: determine-automatic-lockdown - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }} @@ -737,7 +737,7 @@ jobs: } GH_AW_MCP_CONFIG_EOF - name: Download activation artifact - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: activation path: /tmp/gh-aw @@ -812,7 +812,7 @@ jobs: bash /opt/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID" - name: Redact secrets in logs if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); @@ -827,7 +827,7 @@ jobs: SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Safe Outputs if: always() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: safe-output path: ${{ env.GH_AW_SAFE_OUTPUTS }} @@ -835,7 +835,7 @@ jobs: - name: Ingest agent output id: collect_output if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.com,github.githubassets.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com" @@ -849,13 +849,13 @@ jobs: await main(); - name: Upload sanitized agent output if: always() && env.GH_AW_AGENT_OUTPUT - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: agent-output path: ${{ env.GH_AW_AGENT_OUTPUT }} if-no-files-found: warn - name: Upload engine output files - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: agent_outputs path: | @@ -864,7 +864,7 @@ jobs: if-no-files-found: ignore - name: Parse agent logs for step summary if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/ with: @@ -875,7 +875,7 @@ jobs: await main(); - name: Parse MCP Gateway logs for step summary if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); @@ -900,7 +900,7 @@ jobs: - name: Upload agent artifacts if: always() continue-on-error: true - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: agent-artifacts path: | @@ -945,7 +945,7 @@ jobs: ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true - name: Setup threat detection if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: WORKFLOW_NAME: "Docs from Code — Create Draft PR" WORKFLOW_DESCRIPTION: "Picks up documentation issues created by the maui-labs pr-docs-check workflow.\nWhen an issue with '[maui-labs docs]' in the title is opened, this workflow reads\nthe issue body (which contains the source PR details and suggested changes),\nwrites the documentation updates, and creates a draft PR." @@ -993,7 +993,7 @@ jobs: - name: Parse threat detection results id: parse_detection_results if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); @@ -1002,7 +1002,7 @@ jobs: await main(); - name: Upload threat detection log if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: threat-detection.log path: /tmp/gh-aw/threat-detection/detection.log @@ -1048,13 +1048,13 @@ jobs: total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Setup Scripts - uses: github/gh-aw/actions/setup@ffb8573262a0892a8117694ac8c0738e96e846d0 # v0.53.5 + uses: github/gh-aw/actions/setup@4d44d0e89851a877f4ddc0cb6c0197e42b1016c5 # v0.73.0 with: destination: /opt/gh-aw/actions - name: Download agent output artifact id: download-agent-output continue-on-error: true - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: agent-output path: /tmp/gh-aw/safeoutputs/ @@ -1066,7 +1066,7 @@ jobs: echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV" - name: Process No-Op Messages id: noop - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} GH_AW_NOOP_MAX: "1" @@ -1080,7 +1080,7 @@ jobs: await main(); - name: Record Missing Tool id: missing_tool - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} GH_AW_WORKFLOW_NAME: "Docs from Code — Create Draft PR" @@ -1093,7 +1093,7 @@ jobs: await main(); - name: Handle Agent Failure id: handle_agent_failure - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} GH_AW_WORKFLOW_NAME: "Docs from Code — Create Draft PR" @@ -1116,7 +1116,7 @@ jobs: await main(); - name: Handle No-Op Message id: handle_noop_message - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} GH_AW_WORKFLOW_NAME: "Docs from Code — Create Draft PR" @@ -1133,7 +1133,7 @@ jobs: await main(); - name: Handle Create Pull Request Error id: handle_create_pr_error - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} GH_AW_WORKFLOW_NAME: "Docs from Code — Create Draft PR" @@ -1154,12 +1154,12 @@ jobs: matched_command: '' steps: - name: Setup Scripts - uses: github/gh-aw/actions/setup@ffb8573262a0892a8117694ac8c0738e96e846d0 # v0.53.5 + uses: github/gh-aw/actions/setup@4d44d0e89851a877f4ddc0cb6c0197e42b1016c5 # v0.73.0 with: destination: /opt/gh-aw/actions - name: Check team membership for workflow id: check_membership - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_REQUIRED_ROLES: admin,maintainer,write with: @@ -1199,13 +1199,13 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Setup Scripts - uses: github/gh-aw/actions/setup@ffb8573262a0892a8117694ac8c0738e96e846d0 # v0.53.5 + uses: github/gh-aw/actions/setup@4d44d0e89851a877f4ddc0cb6c0197e42b1016c5 # v0.73.0 with: destination: /opt/gh-aw/actions - name: Download agent output artifact id: download-agent-output continue-on-error: true - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: agent-output path: /tmp/gh-aw/safeoutputs/ @@ -1217,7 +1217,7 @@ jobs: echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV" - name: Download patch artifact continue-on-error: true - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: agent-artifacts path: /tmp/gh-aw/ @@ -1245,7 +1245,7 @@ jobs: echo "Git configured with standard GitHub Actions identity" - name: Process Safe Outputs id: process_safe_outputs - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }} GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.com,github.githubassets.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com" @@ -1262,7 +1262,7 @@ jobs: await main(); - name: Upload safe output items manifest if: always() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: safe-output-items path: /tmp/safe-output-items.jsonl diff --git a/docs/fundamentals/shell/flyout.md b/docs/fundamentals/shell/flyout.md index 956f60c759..1072953ecd 100644 --- a/docs/fundamentals/shell/flyout.md +++ b/docs/fundamentals/shell/flyout.md @@ -1,7 +1,7 @@ --- title: ".NET MAUI Shell flyout" description: "Learn how to customize and control a .NET MAUI flyout, which is the optional root menu for a .NET MAUI Shell app." -ms.date: 11/28/2025 +ms.date: 05/12/2026 --- # .NET MAUI Shell flyout @@ -771,6 +771,44 @@ The following example shows hiding an item in the flyout: > [!NOTE] > There's also a `Shell.FlyoutItemIsVisible` attached property, which can be set on , , , and objects. +:::moniker range=">=net-maui-11.0" + +## FlyoutItem badges + +A badge can be displayed on a flyout item to surface unread counts or status indicators. Badges are set on the Shell navigation item by using three bindable properties inherited from `BaseShellItem`: + +- `BadgeText`, of type `string`, is the text displayed on the badge. Set to a non-empty value to show a text or count badge, an empty string to show a dot indicator, or `null` (the default) to hide the badge. +- `BadgeColor`, of type , is the background color of the badge. When `null`, the platform default is used. +- `BadgeTextColor`, of type , is the foreground (text) color of the badge. When `null`, the platform default is used (typically white). + +The following example sets a numeric badge on a flyout item: + +```xaml + + + + + +``` + +To bind the badge text to a view model, use a regular data binding: + +```xaml + + + +``` + +For more information on how badges are rendered on each platform, see [Tab badges](tabs.md#tab-badges). + +:::moniker-end + ## Open and close the flyout programmatically The flyout can be programmatically opened and closed by setting the `Shell.FlyoutIsPresented` bindable property to a `boolean` value that indicates whether the flyout is currently open: diff --git a/docs/fundamentals/shell/tabs.md b/docs/fundamentals/shell/tabs.md index 1280b3fa40..6050934e20 100644 --- a/docs/fundamentals/shell/tabs.md +++ b/docs/fundamentals/shell/tabs.md @@ -1,7 +1,7 @@ --- title: ".NET MAUI Shell tabs" description: "Learn how to customize and control a .NET MAUI TabBar, which represents the bottom tab bar in a .NET MAUI Shell app." -ms.date: 11/28/2025 +ms.date: 05/12/2026 --- # .NET MAUI Shell tabs @@ -282,3 +282,45 @@ In addition, objects can be hidden by setting ``` In this example, the second tab is hidden. + +:::moniker range=">=net-maui-11.0" + +## Tab badges + +A badge can be displayed on a tab to surface unread counts or status indicators. Badges are set on the Shell navigation item (`Tab`, `ShellContent`, or `FlyoutItem`) by using three bindable properties inherited from `BaseShellItem`: + +- `BadgeText`, of type `string`, is the text displayed on the badge. Set to a non-empty value to show a text or count badge, an empty string to show a dot indicator, or `null` (the default) to hide the badge. +- `BadgeColor`, of type , is the background color of the badge. When `null`, the platform default is used. +- `BadgeTextColor`, of type , is the foreground (text) color of the badge. When `null`, the platform default is used (typically white). + +The following example sets a numeric badge on a tab: + +```xaml + + + + +``` + +To bind the badge text to a view model, use a regular data binding: + +```xaml + +``` + +Badge rendering varies by platform: + +- **Android** uses the Material Design `BadgeDrawable`. `BadgeTextColor` maps to `BadgeDrawable.BadgeTextColor`. +- **iOS and Mac Catalyst** use `UITabBarItem.BadgeValue`. `BadgeTextColor` maps to `UITabBarItem.SetBadgeTextAttributes`. +- **Windows** uses the WinUI `InfoBadge` control. Only numeric `BadgeText` values display as a count; non-numeric text and the empty string display as a dot indicator. `BadgeTextColor` maps to `InfoBadge.Foreground`. + +:::moniker-end diff --git a/docs/user-interface/controls/editor.md b/docs/user-interface/controls/editor.md index d141026f97..7720337962 100644 --- a/docs/user-interface/controls/editor.md +++ b/docs/user-interface/controls/editor.md @@ -1,7 +1,7 @@ --- title: "Editor" description: "The .NET MAUI Editor allows you to enter and edit multiple lines of text." -ms.date: 05/13/2025 +ms.date: 05/12/2026 --- # Editor @@ -18,6 +18,12 @@ These properties are backed by o In addition, defines a `Completed` event, which is raised when the user finalizes text in the with the return key. +:::moniker range=">=net-maui-11.0" + + also defines `ReturnCommand` and `ReturnCommandParameter` properties, both of which are backed by objects. `ReturnCommand`, of type , is executed whenever the `Completed` event is raised. `ReturnCommandParameter`, of type `object`, is passed to `ReturnCommand` when it's executed. This lets you bind a view model command directly to the editor's completion gesture without subscribing to the `Completed` event in code-behind. + +:::moniker-end + derives from the class, from which it inherits the following properties: - `CharacterSpacing`, of type `double`, sets the spacing between characters in the text content, including both the user-entered or displayed text and the placeholder text. @@ -114,6 +120,18 @@ void OnEditorCompleted(object sender, EventArgs e) } ``` +:::moniker range=">=net-maui-11.0" + +Alternatively, you can bind a command to the editor's completion gesture by setting `ReturnCommand` and, optionally, `ReturnCommandParameter`. The command is invoked whenever the `Completed` event is raised: + +```xaml + +``` + +:::moniker-end + ## Set character spacing Character spacing can be applied to an by setting the `CharacterSpacing` property to a `double` value: diff --git a/docs/user-interface/images/app-icons.md b/docs/user-interface/images/app-icons.md index b49018b35d..ebc05edd4b 100644 --- a/docs/user-interface/images/app-icons.md +++ b/docs/user-interface/images/app-icons.md @@ -1,7 +1,7 @@ --- title: "Add an app icon to a .NET MAUI app project" description: "Learn how to add an app icon to a .NET MAUI app project. The icon is the logo that represents your app in multiple places, such as the Store, launcher, or app shortcut." -ms.date: 08/30/2024 +ms.date: 05/12/2026 no-loc: ["MauiIcon"] --- @@ -188,6 +188,28 @@ Adaptive launcher icons are composed icons, using a background layer and a foreg The `ForegroundScale` attribute can be optionally specified to rescale the foreground image so that it fits on the app icon. It's a percentage value so 0.65 will be translated as 65%. +:::moniker range=">=net-maui-11.0" + +#### Themed icon monochrome layer + +On Android 13 and higher, the system can render a themed app icon that uses a single monochrome glyph tinted with colors derived from the user's wallpaper. By default, .NET MAUI uses the `ForegroundFile` image as the monochrome layer. To use a different glyph for the themed icon, specify the `MonochromeFile` attribute on the `` item: + +```xml + + + +``` + +The `MonochromeFile` image should be a single-color glyph designed to read clearly when tinted by the system. The image is included in the generated adaptive icon as the `` layer of the `adaptive-icon` drawable. If `MonochromeFile` isn't specified, the foreground image continues to be used as the monochrome source. + +For more information about themed icons on Android, see [Adaptive icons](https://developer.android.com/develop/ui/views/launch/icon_design_adaptive) and [Support themed app icons](https://developer.android.com/about/versions/13/features#themed-app-icons) on developer.android.com. + +:::moniker-end + # [iOS/Mac Catalyst](#tab/macios) The app icon defined by your .NET MAUI app is used to generate an asset catalog icon set for both iOS and macOS platforms. The name of the icon set is defined in the _Info.plist_ file, which on iOS is located at _Platforms\\iOS\\Info.plist_. For macOS, the _Info.plist_ file is located at _Platforms\\MacCatalyst\\Info.plist_. diff --git a/docs/user-interface/material-design.md b/docs/user-interface/material-design.md index 295d0992c3..eb5485ea10 100644 --- a/docs/user-interface/material-design.md +++ b/docs/user-interface/material-design.md @@ -1,7 +1,7 @@ --- title: "Material 3" description: "Learn how to enable Material 3 design on Android in .NET MAUI apps by setting the UseMaterial3 build property to apply modern Material Design theming and components." -ms.date: 04/13/2026 +ms.date: 05/12/2026 --- # Material 3 @@ -257,6 +257,28 @@ The following screenshot shows the difference between Material 2 and Material 3. For more information about the underlying Android component, see [MaterialDatePicker](https://developer.android.com/reference/com/google/android/material/datepicker/MaterialDatePicker). +:::moniker range=">=net-maui-11.0" + +### ImageButton + +The [ImageButton](controls/imagebutton.md) control on Android is rendered using the Material 3 `ShapeableImageView` when the feature is enabled, picking up Material 3 shape, ripple, and elevation behaviors that match other Material 3 buttons. + +For more information about the underlying Android control, see [ShapeableImageView](https://developer.android.com/reference/com/google/android/material/imageview/ShapeableImageView). + +### Switch + +The [Switch](controls/switch.md) control on Android is rendered using the Material 3 `MaterialSwitch` when the feature is enabled, replacing the legacy `SwitchCompat` track and thumb with the updated Material 3 design. + +For more information about the underlying Android control, see [MaterialSwitch](https://developer.android.com/reference/com/google/android/material/materialswitch/MaterialSwitch). + +### Shell + +When the feature is enabled, the [Shell](~/fundamentals/shell/index.md) tab bar on Android is rendered using the Material 3 navigation components. Bottom tabs use the Material 3 `NavigationBar` and top tabs use the Material 3 `TabLayout`, both of which adopt Material 3 color tokens, shape, and selection states. Tab badges set with `BadgeText`, `BadgeColor`, and `BadgeTextColor` are rendered through the Material 3 `BadgeDrawable`. + +For more information about the underlying Android controls, see [NavigationBar](https://developer.android.com/reference/com/google/android/material/navigation/NavigationBar) and [TabLayout](https://developer.android.com/reference/com/google/android/material/tabs/TabLayout). + +:::moniker-end + ## Considerations When enabling Material 3 in your .NET MAUI Android app, consider the following: diff --git a/docs/user-interface/toolbaritem.md b/docs/user-interface/toolbaritem.md index 9142bfb7a1..8684adaa87 100644 --- a/docs/user-interface/toolbaritem.md +++ b/docs/user-interface/toolbaritem.md @@ -1,7 +1,7 @@ --- title: "Display toolbar items" description: "Learn how to add toolbar items, which are a special type of button, to the app's navigation bar." -ms.date: 08/18/2025 +ms.date: 05/12/2026 --- # Display toolbar items @@ -147,3 +147,43 @@ On iOS and Mac Catalyst, secondary items are shown in a pull‑down menu ordered > Keep labels short so they fit comfortably in the pull‑down. Avoid icons for `Secondary` items due to platform inconsistency. ::: moniker-end + +:::moniker range=">=net-maui-11.0" + +## Display a badge on a ToolbarItem + +A badge can be displayed on a to surface counts or status indicators. The `ToolbarItem` class defines three bindable properties for badge support: + +- `BadgeText`, of type `string`, is the text displayed on the badge. Set to a non-empty value to show a text or count badge, an empty string to show a dot indicator, or `null` (the default) to hide the badge. +- `BadgeColor`, of type , is the background color of the badge. When `null`, the platform default is used. +- `BadgeTextColor`, of type , is the foreground (text) color of the badge. When `null`, the platform default is used. + +The following example sets a numeric badge on a toolbar item: + +```xaml + + + +``` + +To bind the badge text to a view model, use a regular data binding: + +```xaml + +``` + +Badges are only displayed on primary toolbar items — items whose is set to or . Secondary (overflow) items don't display badges. + +Badge rendering varies by platform: + +- **Android** uses the Material Design `BadgeDrawable`. Numeric and text badges are supported. `BadgeTextColor` maps to `BadgeDrawable.BadgeTextColor`. +- **iOS and Mac Catalyst** use `UIBarButtonItem.Badge`, which requires iOS 26 or higher. On earlier iOS versions, the badge is silently ignored. `BadgeTextColor` maps to `UIBarButtonItemBadge.ForegroundColor`. +- **Windows** uses the WinUI `InfoBadge` overlaid on the toolbar button. Numeric values display as counts; non-numeric text and the empty string display as a dot indicator. `BadgeTextColor` maps to `InfoBadge.Foreground`. + +:::moniker-end diff --git a/docs/whats-new/dotnet-11.md b/docs/whats-new/dotnet-11.md index 2e38bf0cca..774b5f7e20 100644 --- a/docs/whats-new/dotnet-11.md +++ b/docs/whats-new/dotnet-11.md @@ -1,7 +1,7 @@ --- title: What's new in .NET MAUI for .NET 11 description: Learn about the new features introduced in .NET MAUI for .NET 11. -ms.date: 04/02/2026 +ms.date: 05/12/2026 --- # What's new in .NET MAUI for .NET 11 @@ -11,12 +11,64 @@ The focus of .NET Multi-platform App UI (.NET MAUI) in .NET 11 is to improve pro - [.NET MAUI in .NET 11 Preview 1](https://github.com/dotnet/core/blob/main/release-notes/11.0/preview/preview1/dotnetmaui.md) - [.NET MAUI in .NET 11 Preview 2](https://github.com/dotnet/core/blob/main/release-notes/11.0/preview/preview2/dotnetmaui.md) - [.NET MAUI in .NET 11 Preview 3](https://github.com/dotnet/core/blob/main/release-notes/11.0/preview/preview3/dotnetmaui.md) +- [.NET MAUI in .NET 11 Preview 4](https://github.com/dotnet/core/blob/main/release-notes/11.0/preview/preview4/dotnetmaui.md) > [!IMPORTANT] > Due to working with external dependencies, such as Xcode or Android SDK Tools, the .NET MAUI support policy differs from the [.NET and .NET Core support policy](https://dotnet.microsoft.com/platform/support/policy/maui). For more information, see [.NET MAUI support policy](https://dotnet.microsoft.com/platform/support/policy/maui). In .NET 11, .NET MAUI ships as a .NET workload and multiple NuGet packages. The advantage of this approach is that it enables you to easily pin your projects to specific versions, while also enabling you to easily preview unreleased or experimental builds. +## CoreCLR is the default runtime + +:::moniker range=">=net-maui-11.0" + +Starting in .NET 11 Preview 4, CoreCLR is the default runtime on all .NET MAUI platforms for projects built with and targeting .NET 11. This unifies the runtime across .NET MAUI with benefits for debugging, profiling, Hot Reload, app size, and app performance. For a detailed overview of this transition, see the [announcement blog post](https://aka.ms/maui-coreclr). + +If you need to opt out of CoreCLR and use the Mono runtime instead, set `$(UseMonoRuntime)` to `true` in your project file: + +```xml + + true + +``` + +:::moniker-end + +## `x:Code` directive for inline C# in XAML + +:::moniker range=">=net-maui-11.0" + +Starting in .NET 11 Preview 4, the XAML source generator supports an `x:Code` directive that lets you inline a small block of C# directly inside a XAML file. This makes it easier to keep view-local glue code next to the markup it serves without creating a code-behind partial just for a single helper. The `EnablePreviewFeatures` flag is required for this. For more information, see [GitHub PR #34715](https://github.com/dotnet/maui/pull/34715). + +```xaml + + +