Skip to content

[Windows] Fix for MenuFlyoutItem displaying icon in monochrome instead of original colors#32522

Open
SyedAbdulAzeemSF4852 wants to merge 5 commits intodotnet:mainfrom
SyedAbdulAzeemSF4852:fix-16119
Open

[Windows] Fix for MenuFlyoutItem displaying icon in monochrome instead of original colors#32522
SyedAbdulAzeemSF4852 wants to merge 5 commits intodotnet:mainfrom
SyedAbdulAzeemSF4852:fix-16119

Conversation

@SyedAbdulAzeemSF4852
Copy link
Copy Markdown
Contributor

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 from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

  • MenuFlyoutItem with FileImageSource and UriImageSource displays icon in monochrome instead of original colors.

Root Cause

  • The issue occurred because BitmapIconSource renders images in monochrome mode by default. As a result, the original colors from FileImageSource and UriImageSource were lost when displayed as icons.

Description of Change

  • Updated MenuFlyoutItemHandler.Windows.cs to set ShowAsMonochrome = false for BitmapIconSource, ensuring icons retain their original colors instead of being rendered as monochrome silhouettes.
  • Documentation : ShowAsMonoChrome

Issues Fixed

Fixes #16119

Validated the behaviour in the following platforms

  • Windows
  • Mac
  • Android
  • iOS

Output

Before After

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Nov 12, 2025
@sheiksyedm
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@SyedAbdulAzeemSF4852 SyedAbdulAzeemSF4852 marked this pull request as ready for review November 17, 2025 13:17
Copilot AI review requested due to automatic review settings November 17, 2025 13:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a Windows-specific issue where MenuFlyoutItem icons from FileImageSource and UriImageSource were displayed in monochrome instead of their original colors. The root cause was that BitmapIconSource renders images as monochrome silhouettes by default.

Key Changes

  • Updated MenuFlyoutItemHandler.Windows.cs to set ShowAsMonochrome = false for BitmapIconSource instances
  • Added UI test case to verify the fix with screenshot validation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Core/src/Handlers/MenuFlyoutItem/MenuFlyoutItemHandler.Windows.cs Modified MapSource method to disable monochrome rendering for BitmapIconSource, preserving original icon colors
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16119.cs Added NUnit UI test with screenshot verification for Windows platform
src/Controls/tests/TestCases.HostApp/Issues/Issue16119.cs Created test Shell page with MenuFlyoutItem using FileImageSource to demonstrate the fix

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 9, 2025

🚀 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 -- 32522

Or

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

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Mar 19, 2026
Copy link
Copy Markdown
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

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

Could you please add screenshots?

@sheiksyedm
Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@SyedAbdulAzeemSF4852
Copy link
Copy Markdown
Contributor Author

Could you please add screenshots?

@kubaflo , I’ve added the baseline snapshot for the Windows platform

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues and removed s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) labels Mar 26, 2026
@dotnet dotnet deleted a comment from MauiBot Mar 26, 2026
@MauiBot
Copy link
Copy Markdown
Collaborator

MauiBot commented Mar 26, 2026

🤖 AI Summary

📊 Expand Full Review4f3a822 · [Windows] Add WaitForElement to ensure menu flyout is open before screenshot
🔍 Pre-Flight — Context & Validation

Issue: #16119 - MenuFlyoutItem with FileImageSource doesn't display icon properly (monochrome silhouette on Windows)
PR: #32522 - [Windows] Fix for MenuFlyoutItem displaying icon in monochrome instead of original colors
Platforms Affected: Windows only
Files Changed: 2 implementation files, 3 test files

Key Findings

  • Root cause: BitmapIconSource.ShowAsMonochrome defaults to true in WinUI 3; FileImageSource/UriImageSource icons render as white monochrome silhouettes instead of original colors
  • Fix applies to both MenuFlyoutItemHandler.Windows.cs and MenuFlyoutSubItemHandler.Windows.cs — both had the same monochrome issue for icon sources
  • Fix is minimal and correct: cast to BitmapIconSource, set ShowAsMonochrome = false, then call CreateIconElement()
  • Test added: Issue16119.cs in HostApp and TestCases.Shared.Tests — uses VerifyScreenshot() to compare icon appearance
  • Gate FAILED: VerifyMenuFlyoutIconDisplaysOriginalColor PASSES both WITH and WITHOUT the fix — screenshot comparison cannot reliably detect the monochrome-vs-color difference
  • The snapshot baseline (VerifyMenuFlyoutIconDisplaysOriginalColor.png) was captured with the fix applied but the diff is imperceptible at screenshot resolution or tolerance absorbs it
  • Prior agent review found the same gate failure. A previous agent suggestion to test native WinUI icon state was noted but not implemented.
  • Test category is UITestCategories.Page — questionable; UITestCategories.MenuBar or similar would be more accurate, but Page is acceptable
  • The test taps the menu to open it (App.Tap("Menu Flyout Item")) and waits for Hello World to be visible before taking screenshot — setup is correct

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #32522 Set ShowAsMonochrome = false for BitmapIconSource in MapSource for both MenuFlyoutItemHandler and MenuFlyoutSubItemHandler ❌ GATE FAILED (test passes both with/without fix) MenuFlyoutItemHandler.Windows.cs, MenuFlyoutSubItemHandler.Windows.cs Fix logic is correct; test quality is the problem

🔧 Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix (claude-opus-4.6) Replace VerifyScreenshot() with button-triggered BitmapIcon.ShowAsMonochrome check via platform view; label shows "COLOR"/"MONOCHROME" ✅ PASS Issue16119.cs (HostApp), Issue16119.cs (Shared.Tests) Works; requires button tap in test
2 try-fix (claude-sonnet-4.6) Auto-check via HandlerChanged event + DispatchDelayed(100ms); no button tap needed ✅ PASS Same 2 files Works; cleaner than #1; timing relies on 100ms delay
3 try-fix (gpt-5.3-codex) OnAppearing() override + dispatcher delay reads platform view property ✅ PASS Same 2 files Works; OnAppearing may fire before handler attaches
4 try-fix (gpt-5.4) Inline HandlerChanged lambda; minimal code, no button, no delay ✅ PASS Same 2 files Best UI test approach: minimal, idiomatic, deterministic
PR PR #32522 Set ShowAsMonochrome = false for BitmapIconSource in MapSource for both handlers ❌ GATE FAILED (test passes both with/without fix) MenuFlyoutItemHandler.Windows.cs, MenuFlyoutSubItemHandler.Windows.cs Handler fix logic correct; test quality is the problem

Cross-Pollination

Model Round New Ideas? Details
claude-opus-4.6 2 Yes NEW IDEA: Use a distinctly multi-colored test image where monochrome rendering collapses all colors to tint — making VerifyScreenshot() detect the difference visually
claude-sonnet-4.6 2 Yes NEW IDEA: Add a [Fact] device test in ContextFlyoutTests.Windows.cs using existing CreateHandlerAndAddToWindow + OnLoadedAsync pattern — directly assert BitmapIcon.ShowAsMonochrome == false on the WinUI platform view
gpt-5.3-codex 2 Yes NEW IDEA: Add a Windows-only handler mapping unit test that instantiates MenuFlyoutItem + FileImageSource, runs MapSource, and asserts native icon property
gpt-5.4 2 Yes NEW IDEA: Replace screenshot UITest with a Windows-only DeviceTest that runs the handler and directly asserts BitmapIcon.ShowAsMonochrome == false

Cross-pollination convergence: 3 out of 4 models independently suggested a device test in ContextFlyoutTests.Windows.cs — this is a well-established pattern in the codebase and cleaner than modifying UI test HostApp pages. Not run empirically but the pattern already exists in the repo.

Exhausted: Yes
Selected Fix: Candidate #4 (inline HandlerChanged lambda) for improving the UI test — minimal, clean, deterministic. The device test approach from cross-pollination is even better for the long term but is a larger change beyond the PR scope.


📋 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Issue #16119, Windows-only, 2 impl + 3 test files
Gate ❌ FAILED Windows — test passes both with and without the fix
Try-Fix ✅ COMPLETE 4 attempts, 4 passing
Report ✅ COMPLETE

Summary

The handler fix is correct — setting BitmapIconSource.ShowAsMonochrome = false before calling CreateIconElement() in both MenuFlyoutItemHandler.Windows.cs and MenuFlyoutSubItemHandler.Windows.cs properly preserves icon colors. However, the test is inadequate: VerifyScreenshot() compares against a baseline captured with the fix applied, but the monochrome vs. color visual difference is imperceptible at screenshot resolution. The gate confirmed: the test passes both with and without the fix, meaning a future regression would go undetected.

All 4 try-fix attempts found a reliable replacement: inspect the native WinUI BitmapIcon.ShowAsMonochrome property directly via HandlerChanged and assert it equals false. This deterministically catches regressions.

Root Cause

BitmapIconSource.ShowAsMonochrome defaults to true in WinUI 3. When FileImageSource or UriImageSource is converted to an icon, the resulting BitmapIconSource inherits this default, rendering the icon as a white monochrome silhouette.

Fix Quality

Handler fix: ✅ Correct and minimal. No concerns.

Test: ❌ Needs replacement. The VerifyScreenshot() approach cannot detect this specific visual regression. The recommended fix (Attempt 4 — gpt-5.4) is the most minimal and idiomatic:

HostApp change (src/Controls/tests/TestCases.HostApp/Issues/Issue16119.cs):

// Add a status label
var monochromeStatus = new Label { AutomationId = "MonochromeStatus", Text = "PENDING", ... };

// After creating menuFlyoutItem, subscribe to HandlerChanged:
menuFlyoutItem.HandlerChanged += (_, _) =>
{
#if WINDOWS
    monochromeStatus.Text = menuFlyoutItem.Handler?.PlatformView is
        Microsoft.UI.Xaml.Controls.MenuFlyoutItem { Icon: Microsoft.UI.Xaml.Controls.BitmapIcon { ShowAsMonochrome: false } }
        ? "COLOR" : "MONOCHROME";
#endif
};

Test change (src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16119.cs):

// Replace VerifyScreenshot() with:
App.Tap("Menu Flyout Item");
Assert.That(App.WaitForElement("MonochromeStatus").GetText(), Is.EqualTo("COLOR"));

Alternative (from cross-pollination, 3/4 models agreed): Add a [Fact] device test to src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.Windows.cs using the existing CreateHandlerAndAddToWindow + OnLoadedAsync pattern. This is even cleaner — no HostApp changes needed, direct BitmapIcon.ShowAsMonochrome assertion on the mapped platform view.

Required Changes

  1. Replace VerifyScreenshot() with HandlerChanged-based property assertion in HostApp + test (see diff above), OR add a device test in ContextFlyoutTests.Windows.cs
  2. Remove the snapshot file src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyMenuFlyoutIconDisplaysOriginalColor.png (it was captured with the fix; no longer needed if test changes)
  3. Optionally delete the Issue16119DescriptionLabel since it was replaced by MonochromeStatus

@MauiBot
Copy link
Copy Markdown
Collaborator

MauiBot commented Mar 29, 2026

🚦 Gate - Test Before and After Fix

📊 Expand Full Gate4f3a822 · [Windows] Add WaitForElement to ensure menu flyout is open before screenshot

Gate Result: ❌ FAILED

Platform: WINDOWS · Base: main · Merge base: 720a9d4a

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue16119 Issue16119 ❌ PASS — 568s ✅ PASS — 455s
🔴 Without fix — 🖥️ Issue16119: PASS ❌ · 568s
  Determining projects to restore...
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 50.96 sec).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 50.96 sec).
  Restored D:\a\1\s\src\Controls\Foldable\src\Controls.Foldable.csproj (in 390 ms).
  Restored D:\a\1\s\src\BlazorWebView\src\Maui\Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 5.44 sec).
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 31 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 23 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 5.26 sec).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 48 ms).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 59 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 23 ms).
  Restored D:\a\1\s\src\Controls\tests\TestCases.HostApp\Controls.TestCases.HostApp.csproj (in 972 ms).
  3 of 14 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:05:48.39
  Determining projects to restore...
  Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils\VisualTestUtils.csproj (in 779 ms).
  Restored D:\a\1\s\src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj (in 1.85 sec).
  Restored D:\a\1\s\src\TestUtils\src\UITest.Core\UITest.Core.csproj (in 3 ms).
  Restored D:\a\1\s\src\TestUtils\src\UITest.Appium\UITest.Appium.csproj (in 1.64 sec).
  Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils.MagickNet\VisualTestUtils.MagickNet.csproj (in 4.98 sec).
  Restored D:\a\1\s\src\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj (in 6.52 sec).
  Restored D:\a\1\s\src\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj (in 4 ms).
  Restored D:\a\1\s\src\Controls\tests\TestCases.WinUI.Tests\Controls.TestCases.WinUI.Tests.csproj (in 9.57 sec).
  7 of 15 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
  Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
  Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
  UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
  UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
  UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
  VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
  VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
  Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 3/30/2026 7:43:33 PM FixtureSetup for Issue16119(Windows)
>>>>> 3/30/2026 7:43:43 PM VerifyMenuFlyoutIconDisplaysOriginalColor Start
>>>>> 3/30/2026 7:43:46 PM VerifyMenuFlyoutIconDisplaysOriginalColor Stop
  Passed VerifyMenuFlyoutIconDisplaysOriginalColor [2 s]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.09]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.27]   Discovered:  Controls.TestCases.WinUI.Tests

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 35.0252 Seconds

🟢 With fix — 🖥️ Issue16119: PASS ✅ · 455s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:05:35.93
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
  Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
  Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13690802
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
  UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
  UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
  UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
  VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
  VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
  Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 3/30/2026 7:51:09 PM FixtureSetup for Issue16119(Windows)
>>>>> 3/30/2026 7:51:19 PM VerifyMenuFlyoutIconDisplaysOriginalColor Start
>>>>> 3/30/2026 7:51:22 PM VerifyMenuFlyoutIconDisplaysOriginalColor Stop
  Passed VerifyMenuFlyoutIconDisplaysOriginalColor [2 s]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.11]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.33]   Discovered:  Controls.TestCases.WinUI.Tests

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 27.6841 Seconds

⚠️ Issues found
  • Issue16119 PASSED without fix (should fail) — tests don't catch the bug
📁 Fix files reverted (3 files)
  • eng/pipelines/ci-copilot.yml
  • src/Core/src/Handlers/MenuFlyoutItem/MenuFlyoutItemHandler.Windows.cs
  • src/Core/src/Handlers/MenuFlyoutSubItem/MenuFlyoutSubItemHandler.Windows.cs

Copy link
Copy Markdown
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

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

Looks like the test couldn't catch a bug before fix - could you please verify?

@SyedAbdulAzeemSF4852
Copy link
Copy Markdown
Contributor Author

Looks like the test couldn't catch a bug before fix - could you please verify?

@kubaflo, The gate failed. I verified locally—without the fix, the image renders in monochrome; with the fix, it renders correctly. Below is the screenshot comparison showing the difference with and without the fix.

Without_Fix With_Fix

@MauiBot MauiBot added s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) s/agent-changes-requested AI agent recommends changes - found a better alternative or issues and removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-review-incomplete AI agent could not complete all phases (blocker, timeout, error) labels Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-gate-failed AI could not verify tests catch the bug s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MenuFlyoutItem with FileImageSource doesn't display icon properly

6 participants