[Windows] Fix for MenuFlyoutItem displaying icon in monochrome instead of original colors#32522
[Windows] Fix for MenuFlyoutItem displaying icon in monochrome instead of original colors#32522SyedAbdulAzeemSF4852 wants to merge 5 commits intodotnet:mainfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
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.csto setShowAsMonochrome = falsefor 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 |
55f61ee to
236a3c5
Compare
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 32522Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 32522" |
kubaflo
left a comment
There was a problem hiding this comment.
Could you please add screenshots?
|
/azp run maui-pr-uitests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
@kubaflo , I’ve added the baseline snapshot for the Windows platform |
🤖 AI Summary📊 Expand Full Review —
|
| # | 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
- Replace
VerifyScreenshot()withHandlerChanged-based property assertion in HostApp + test (see diff above), OR add a device test inContextFlyoutTests.Windows.cs - 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) - Optionally delete the
Issue16119DescriptionLabelsince it was replaced byMonochromeStatus
🚦 Gate - Test Before and After Fix📊 Expand Full Gate —
|
| 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.ymlsrc/Core/src/Handlers/MenuFlyoutItem/MenuFlyoutItemHandler.Windows.cssrc/Core/src/Handlers/MenuFlyoutSubItem/MenuFlyoutSubItemHandler.Windows.cs
kubaflo
left a comment
There was a problem hiding this comment.
Looks like the test couldn't catch a bug before fix - could you please verify?
e2af807 to
7c9b568
Compare
@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.
|


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
Root Cause
Description of Change
Issues Fixed
Fixes #16119
Validated the behaviour in the following platforms
Output