Skip to content

Fix MenuFlyoutItem IconImageSource runtime updates - #40072

Merged
kubaflo merged 3 commits into
dotnet:candidate/11.0.1xx-sr2from
KitKeen:fix/menuflyoutitem-iconimagesource-runtime-update
Nov 13, 2026
Merged

kubaflo merged 3 commits into
dotnet:candidate/11.0.1xx-sr2from
KitKeen:fix/menuflyoutitem-iconimagesource-runtime-update

Conversation

@KitKeen

@KitKeen KitKeen commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

Description of Change

When MenuItem.IconImageSource is updated at runtime (either by assigning/binding a new ImageSource or by mutating a property on the bound ImageSource), MenuFlyoutItem did not update its native menu icon:

  1. MenuItem defines IconImageSourceProperty (IconImageSource), whereas IMenuElement / IImageSourcePart maps nameof(IMenuElement.Source) (Source). OnImageSourceChanged and OnImageSourceSourceChanged now notify Handler?.UpdateValue(nameof(IMenuElement.Source)).
  2. MenuFlyoutItemHandler.Mapper previously only mapped nameof(IMenuElement.Source) on Windows. Added MapSource for iOS and MacCatalyst (updating UIAction.Image / UICommand.Image via MenuExtensions.UpdateImageSource, and syncing command.Image in MauiUIApplicationDelegate.ValidateCommand).
  3. Added unit tests in MenuItemTests and device tests for Issue17210 on Windows, iOS, and MacCatalyst.

Issues Fixed

Fixes #17210

@KitKeen
KitKeen temporarily deployed to copilot-pat-pool November 9, 2026 11:11 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40072

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40072"

@azure-pipelines

This comment has been minimized.

@KitKeen
KitKeen temporarily deployed to copilot-pat-pool November 9, 2026 11:11 — with GitHub Actions Inactive
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Nov 9, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@KitKeen! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @KitKeen! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@KitKeen
KitKeen temporarily deployed to copilot-pat-pool November 9, 2026 11:12 — with GitHub Actions Inactive
@KitKeen
KitKeen temporarily deployed to copilot-pat-pool November 9, 2026 11:14 — with GitHub Actions Inactive
@KitKeen
KitKeen temporarily deployed to copilot-pat-pool November 9, 2026 11:15 — with GitHub Actions Inactive
@KitKeen
KitKeen temporarily deployed to copilot-pat-pool November 9, 2026 11:16 — with GitHub Actions Inactive
@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 9, 2026
@azure-pipelines

This comment has been minimized.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 1 finding

Reviewed commit 730a112.

See inline comments for details.


viewModel.Icon = CreateIcon("B", Colors.Blue);

var updatedImage = handler.PlatformView.Image;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[moderate] Regression Prevention and Test Coverage - This test checks only the handler-owned command, so it would still pass if the new image synchronization in MauiUIApplicationDelegate.ValidateCommand were removed. The menu-bar scenario in #17210 also needs the separately validated command to receive the updated icon. Add a regression assertion using a separate UICommand with the handler command's PropertyList: change the bound icon, call ValidateCommand, and verify that command's image updates. The current fixture never exercises that part of the fix.

@MauiBot

This comment has been minimized.

@MauiBot MauiBot added s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) and removed s/agent-review-in-progress AI review is currently running for this PR labels Nov 9, 2026
@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 9, 2026
@azure-pipelines

This comment has been minimized.

@MauiBot

This comment has been minimized.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 9, 2026
@kubaflo
kubaflo merged commit 0698313 into dotnet:candidate/11.0.1xx-sr2 Nov 13, 2026
28 of 38 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The headless-test fallback fails to restore global application references, leaving subsequent tests with an uninitialized fake application.

3 open issues
What changed in this PR

Addresses #17210 by connecting runtime MenuFlyoutItem.IconImageSource changes to native icon updates on Windows, iOS, and MacCatalyst.

Changes:

  • Notifies the handler when an icon source is replaced or mutated.
  • Adds Apple source mapping and synchronizes icons during menu-command validation.
  • Adds unit and device tests for source notifications, bound icons, and command validation.
File Description
src/​Core/​src/​PublicAPI/​net-maccatalyst/​PublicAPI.Unshipped.txt Records the MacCatalyst MapSource API.
src/​Core/​src/​PublicAPI/​net-ios/​PublicAPI.Unshipped.txt Records the iOS MapSource API.
src/​Core/​src/​Platform/​iOS/​MenuExtensions.cs Updates images on native actions and commands.
src/​Core/​src/​Platform/​iOS/​MauiUIApplicationDelegate.Menu.cs Copies updated icons to validated commands.
src/​Core/​src/​Handlers/​MenuFlyoutItem/​MenuFlyoutItemHandler.iOS.cs Implements the Apple source mapper.
src/​Core/​src/​Handlers/​MenuFlyoutItem/​MenuFlyoutItemHandler.cs Registers source mapping across supported platforms.
src/​Controls/​tests/​DeviceTests/​Elements/​MenuFlyoutItem/​Issue17210.Windows.cs Tests bound icon replacement on Windows.
src/​Controls/​tests/​DeviceTests/​Elements/​MenuFlyoutItem/​Issue17210.iOS.cs Tests Apple icon replacement and command synchronization.
src/​Controls/​tests/​Core.UnitTests/​MenuItemTests.cs Tests handler notifications for icon changes.
src/​Controls/​src/​Core/​Menu/​MenuItem.cs Dispatches source updates after replacement or mutation.

Review effort: Balanced

Comment on lines +80 to +81
var appDelegate = (MauiUIApplicationDelegate.Current as MauiUIApplicationDelegate) ?? new TestApplicationDelegate();
appDelegate.ValidateCommand(validatedCommand);
#if MACCATALYST || IOS || WINDOWS
[nameof(IMenuElement.IsEnabled)] = MapIsEnabled
[nameof(IMenuElement.IsEnabled)] = MapIsEnabled,
[nameof(IMenuElement.Source)] = MapSource,
Comment on lines +29 to +30
if (uiMenuElement is UIAction action)
action.Image = image;
kubaflo added a commit that referenced this pull request Nov 13, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 13, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 13, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes #17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by #40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to #40116 and #40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo kubaflo added this to the .NET 11 SR2 milestone Nov 24, 2026
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

### Description of Change

When `MenuItem.IconImageSource` is updated at runtime (either by
assigning/binding a new `ImageSource` or by mutating a property on the
bound `ImageSource`), `MenuFlyoutItem` did not update its native menu
icon:

1. `MenuItem` defines `IconImageSourceProperty` (`IconImageSource`),
whereas `IMenuElement` / `IImageSourcePart` maps
`nameof(IMenuElement.Source)` (`Source`). `OnImageSourceChanged` and
`OnImageSourceSourceChanged` now notify
`Handler?.UpdateValue(nameof(IMenuElement.Source))`.
2. `MenuFlyoutItemHandler.Mapper` previously only mapped
`nameof(IMenuElement.Source)` on Windows. Added `MapSource` for iOS and
MacCatalyst (updating `UIAction.Image` / `UICommand.Image` via
`MenuExtensions.UpdateImageSource`, and syncing `command.Image` in
`MauiUIApplicationDelegate.ValidateCommand`).
3. Added unit tests in `MenuItemTests` and device tests for `Issue17210`
on Windows, iOS, and MacCatalyst.

### Issues Fixed

Fixes dotnet#17210

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

This is an explicitly coordinated, candidate-only compilation repair for
dotnet#40116, based on `candidate/11.0.1xx-sr2` at
`7e47665ecb7f68d3fb31f8d02806e2bf177f505d`.

### Description of Change

<!-- Enter description of the fix in this section -->

Add the missing `Microsoft.Maui.Hosting` import to `Issue17210.iOS.cs`,
introduced by dotnet#40072 (`0698313d8d9e5ccf1d1f4adabe1fba62699870c7`). Its
nested `TestApplicationDelegate.CreateMauiApp()` returns `MauiApp`,
which is declared in that namespace. The file compiles for both iOS and
Mac Catalyst.

This resolves the two CS0246 compiler failures in [maui-pr 1679721's
Debug compiler
log](https://dev.azure.com/dnceng-public/public/_apis/build/builds/1679721/logs/207)
(original diagnostics at physical lines 655 and 672; repeated summary at
1062 and 1063). No product code, assertions, test registration, override
implementation, project settings, or pipeline changes.

#### Compilation validation

Native full-project `Compile` validation, **diagnostic toolchain only**:
.NET SDK **11.0.100**, Apple SDK **27.2**, Xcode **27.2 (27B52)**. The
candidate's pinned SDK `11.0.101-servicing.26559.106` / Apple **27.0**
was unavailable locally. This is not pinned-toolchain certification or a
runtime test.

| Source state | iOS | Mac Catalyst |
| --- | --- | --- |
| Original candidate | CS0246: `MauiApp` | CS0246: `MauiApp` |
| Import added | 0 errors | 0 errors |
| Only import removed | Same CS0246 | Same CS0246 |
| Import restored | 0 errors | 0 errors |

Successful diagnostic runs retain the existing
`CollectionViewTests.iOS.cs:180` CS0618 obsolete-handler diagnostic as a
warning via **invocation-only** `-p:WarningsNotAsErrors=CS0618`; no
warning settings are committed. Without that flag, the import eliminates
CS0246 but this unrelated existing diagnostic remains an error.
Successful runs each report two warnings: that CS0618 and the existing
runner MAUI1001 warning.

Compilation commands below passed for both targets with the import,
failed with the same missing-type error when only the import was
removed, and passed again when restored (binary-log paths omitted):

```bash
for platform in ios maccatalyst; do
  rid=maccatalyst-arm64
  if [ "$platform" = ios ]; then rid=iossimulator-arm64; fi
  dotnet build src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
    -c Debug -f "net11.0-$platform" -t:Compile \
    -p:MauiDeviceTestsPlatforms="net11.0-$platform" \
    -p:MauiPlatforms="net11.0-${platform}27.2" \
    -p:IosTargetFrameworkVersion=27.2 \
    -p:IosTargetFrameworkVersionSdkDefault=27.2 \
    -p:MacCatalystTargetFrameworkVersion=27.2 \
    -p:MacCatalystTargetFrameworkVersionSdkDefault=27.2 \
    -p:RuntimeIdentifier="$rid" \
    -p:IncludeAndroidTargetFrameworks=false \
    -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeIosTargetFrameworks=false \
    -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false \
    -p:WarningsNotAsErrors=CS0618 -v:q
done
```

`dotnet format Microsoft.Maui.sln --no-restore --include
src/Controls/tests/DeviceTests/Elements/MenuFlyoutItem/Issue17210.iOS.cs
--exclude Templates/src --exclude-diagnostics CA1822 --verbosity quiet`
— passed.

`git diff --check` — passed. Runtime tests and local Release compilation
were not run; this repair changes name resolution only. No additional
broad CI runs were manually queued.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Relates to dotnet#40116 and dotnet#40072.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binding IconImageSource on MenuFlyoutItem does not update on runtime.

4 participants