Repository navigation
Fix SwipeItem background not updating on AppTheme change - #36271
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36271Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36271" |
|
Hey there @@Shalini-Ashokan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 2 findings
See inline comments for details.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Fixes SwipeItem (and associated UI test coverage) so a BackgroundColor set via AppThemeBinding updates immediately when the app theme changes, by ensuring the handler is notified and the correct mapper key is used.
Changes:
- Added a
propertyChangedcallback toSwipeItem.BackgroundColorPropertyto triggerHandler.UpdateValue(nameof(ISwipeItemMenuItem.Background))on theme-driven updates. - Aligned
SwipeItemMenuItemHandler’s mapper key tonameof(ISwipeItemMenuItem.Background)for clarity/consistency with the handler’s virtual view type. - Added a new HostApp repro page + UI test for issue #31917 (theme toggle + visual verification).
Reviewed changes
Copilot reviewed 4 out of 10 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.cs | Uses ISwipeItemMenuItem.Background as the mapper key for the swipe item background mapping. |
| src/Controls/src/Core/SwipeView/SwipeItem.cs | Notifies the handler when BackgroundColor changes so theme updates propagate to the platform view. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue31917.cs | Adds a repro page toggling theme and showing SwipeItem/SwipeItemView background updates. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue31917.cs | Adds a visual UI test verifying background changes after an app theme switch. |
This comment has been minimized.
This comment has been minimized.
I have committed the failure image. |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
| static void OnBackgroundColorPropertyChanged(BindableObject bindable, object oldValue, object newValue) | ||
| { | ||
| if (bindable is SwipeItem swipeItem) | ||
| swipeItem.Handler?.UpdateValue(nameof(ISwipeItemMenuItem.Background)); |
There was a problem hiding this comment.
🔍 AI-Generated Review (multi-model)
[major] Regression Prevention / Handler Mapper — This refreshes only the background mapper, so SwipeItem font icons whose color is derived from the background can keep the old tint after an AppTheme change. The #23074 path tints FontImageSource without an explicit Color inside the Source mapper from item.GetTextColor(); on Android/iOS that tint is applied when the source is set, not when BackgroundColor changes. Concrete scenario: a SwipeItem with IconImageSource = new FontImageSource { Color = null } and light/dark AppTheme background changes from light to dark; the text/background update, but the icon remains tinted for the old background. Please refresh the font-icon source/tint when the background changes and add coverage for that case.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@Shalini-Ashokan — new AI review results are available based on this last commit:
7b513b4. To request a fresh review after new comments or commits, comment/review rerun.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ✅ PASSED
Platform: ANDROID · Base: main · Merge base: 0395a53b
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue31917 Issue31917 |
✅ FAIL — 1398s | ✅ PASS — 812s |
🔴 Without fix — 🖥️ Issue31917: FAIL ✅ · 1398s
Determining projects to restore...
Restored /home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 1.02 sec).
Restored /home/vsts/work/1/s/src/Essentials/src/Essentials.csproj (in 4.74 sec).
Restored /home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 8.22 sec).
Restored /home/vsts/work/1/s/src/Core/src/Core.csproj (in 2.1 sec).
Restored /home/vsts/work/1/s/src/Core/maps/src/Maps.csproj (in 835 ms).
Restored /home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 38 ms).
Restored /home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj (in 28 ms).
Restored /home/vsts/work/1/s/src/Controls/Foldable/src/Controls.Foldable.csproj (in 72 ms).
Restored /home/vsts/work/1/s/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 608 ms).
Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj (in 1.73 sec).
1 of 11 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:10:22.43
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Starting: Intent { act=android.settings.SETTINGS }
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Determining projects to restore...
Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils/VisualTestUtils.csproj (in 1.35 sec).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.NUnit/UITest.NUnit.csproj (in 1.41 sec).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Core/UITest.Core.csproj (in 9 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/VisualTestUtils.MagickNet/VisualTestUtils.MagickNet.csproj (in 8.22 sec).
Restored /home/vsts/work/1/s/src/Controls/tests/CustomAttributes/Controls.CustomAttributes.csproj (in 7 ms).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj (in 11 ms).
Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj (in 5.18 sec).
Restored /home/vsts/work/1/s/src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj (in 2.53 sec).
5 of 13 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.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.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 07/13/2026 18:04:07 FixtureSetup for Issue31917(Android)
>>>>> 07/13/2026 18:08:05 The FixtureSetup threw an exception. Attempt 0/1.
Exception details: System.TimeoutException: SwipeItemView and SwipeItem background doesn't update on AppTheme change (Light/Dark) (the app did not recover after crash-recovery attempts)
at Microsoft.Maui.TestCases.Tests.UtilExtensions.WaitForGoToTestButtonWithRecovery(IApp app, String timeoutMessage) in /_/src/Controls/tests/TestCases.Shared.Tests/UtilExtensions.cs:line 91
at Microsoft.Maui.TestCases.Tests._IssuesUITest.NavigateToIssue(String issue) in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 54
at Microsoft.Maui.TestCases.Tests._IssuesUITest.TryToResetTestState() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 25
at Microsoft.Maui.TestCases.Tests.UITest.FixtureSetup() in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 576
>>>>> 07/13/2026 18:08:08 FixtureSetup for Issue31917(Android)
>>>>> 07/13/2026 18:12:01 The FixtureSetup threw an exception. Attempt 1/1.
Exception details: System.TimeoutException: SwipeItemView and SwipeItem background doesn't update on AppTheme change (Light/Dark) (the app did not recover after crash-recovery attempts)
at Microsoft.Maui.TestCases.Tests.UtilExtensions.WaitForGoToTestButtonWithRecovery(IApp app, String timeoutMessage) in /_/src/Controls/tests/TestCases.Shared.Tests/UtilExtensions.cs:line 91
at Microsoft.Maui.TestCases.Tests._IssuesUITest.NavigateToIssue(String issue) in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 54
at Microsoft.Maui.TestCases.Tests._IssuesUITest.TryToResetTestState() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 25
at Microsoft.Maui.TestCases.Tests.UITest.FixtureSetup() in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 576
>>>>> 07/13/2026 18:12:01 Log types: logcat, bugreport, server
>>>>> 07/13/2026 18:12:02 Log types: logcat, bugreport, server
Failed SwipeItemBackgroundShouldUpdateOnAppThemeChange [9 m 10 s]
Error Message:
OneTimeSetUp: System.TimeoutException : SwipeItemView and SwipeItem background doesn't update on AppTheme change (Light/Dark) (the app did not recover after crash-recovery attempts)
Stack Trace:
at Microsoft.Maui.TestCases.Tests.UtilExtensions.WaitForGoToTestButtonWithRecovery(IApp app, String timeoutMessage) in /_/src/Controls/tests/TestCases.Shared.Tests/UtilExtensions.cs:line 91
at Microsoft.Maui.TestCases.Tests._IssuesUITest.NavigateToIssue(String issue) in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 54
at Microsoft.Maui.TestCases.Tests._IssuesUITest.TryToResetTestState() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 25
at Microsoft.Maui.TestCases.Tests.UITest.FixtureSetup() in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 576
at UITest.Appium.NUnit.UITestBase.OneTimeSetup() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 221
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Setup failed for test fixture Microsoft.Maui.TestCases.Tests.Issues.Issue31917(Android)
System.TimeoutException : SwipeItemView and SwipeItem background doesn't update on AppTheme change (Light/Dark) (the app did not recover after crash-recovery attempts)
StackTrace: at Microsoft.Maui.TestCases.Tests.UtilExtensions.WaitForGoToTestButtonWithRecovery(IApp app, String timeoutMessage) in /_/src/Controls/tests/TestCases.Shared.Tests/UtilExtensions.cs:line 91
at Microsoft.Maui.TestCases.Tests._IssuesUITest.NavigateToIssue(String issue) in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 54
at Microsoft.Maui.TestCases.Tests._IssuesUITest.TryToResetTestState() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/_IssuesUITest.cs:line 25
at Microsoft.Maui.TestCases.Tests.UITest.FixtureSetup() in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 576
at UITest.Appium.NUnit.UITestBase.OneTimeSetup() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 221
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
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.21] Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.73] Discovered: Controls.TestCases.Android.Tests
Results File: /home/vsts/work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue31917.trx
Total tests: 1
Failed: 1
Test Run Failed.
Total time: 9.4318 Minutes
>>> TRX_RESULT_FILE: /home/vsts/work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue31917.trx
🟢 With fix — 🖥️ Issue31917: PASS ✅ · 812s
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:10:52.67
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Starting: Intent { act=android.settings.SETTINGS }
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.100-ci+azdo.14640422
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.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.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 07/13/2026 18:25:25 FixtureSetup for Issue31917(Android)
>>>>> 07/13/2026 18:25:28 SwipeItemBackgroundShouldUpdateOnAppThemeChange Start
>>>>> 07/13/2026 18:25:37 SwipeItemBackgroundShouldUpdateOnAppThemeChange Stop
Passed SwipeItemBackgroundShouldUpdateOnAppThemeChange [8 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.15] Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.63] Discovered: Controls.TestCases.Android.Tests
Results File: /home/vsts/work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue31917.trx
Test Run Successful.
Total tests: 1
Passed: 1
Total time: 32.5234 Seconds
>>> TRX_RESULT_FILE: /home/vsts/work/1/s/CustomAgentLogsTmp/UITests/TestResults/Issue31917.trx
📁 Fix files reverted (4 files)
src/Controls/src/Core/SwipeView/SwipeItem.cssrc/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.Windows.cssrc/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.cssrc/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.iOS.cs
📱 UI Tests — SwipeView,ViewBaseTests
Detected UI test categories: SwipeView,ViewBaseTests
✅ Deep UI tests — 195 passed, 0 failed across 2 categories on platform-pool agent (replaces in-process counts above).
🧪 UI Test Execution Results (deep, platform pool)
| Category | Tests | Snapshot diffs |
|---|---|---|
SwipeView |
77/77 ✓ | — |
ViewBaseTests |
118/119 ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
📋 Pre-Flight — Context & Validation
Issue: #31917 - SwipeItemView and SwipeItem background doesn't update on AppTheme change (Light/Dark)
PR: #36271 - Fix SwipeItem background update on AppTheme change
Platforms Affected: Android, iOS, MacCatalyst, Windows handler code; UI test runs on Android/iOS/MacCatalyst and excludes Windows.
Files Changed: 4 implementation, 8 test/snapshot
Key Findings
- PR fix changes
SwipeItem.BackgroundColorPropertyto notify theISwipeItemMenuItem.Backgroundmapper when app-theme-bound colors change. - The mapper key was corrected from
IView.BackgroundtoISwipeItemMenuItem.Background, aligning the property update with the virtual view interface used by the handler. - iOS and Windows
MapBackgroundnow refresh text color after background changes; Android already performed text-color refresh in its existing background path. - Gate evidence already provided: Android UI test
Issue31917fails without the fix and passes with the PR fix. - GitHub PR/issue comments, review surfaces, and required checks were unavailable because
ghis not authenticated in this environment.
Code Review Summary
Verdict: NEEDS_DISCUSSION
Confidence: medium
Errors: 0 | Warnings: 1 | Suggestions: 1
Key code review findings:
- ⚠ Windows handler code changed but the added UI test excludes Windows because SwipeView automation is unavailable on Windows.
- ℹ Consider lower-level mapper/property propagation coverage if feasible to supplement screenshot UI coverage.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #36271 | Add SwipeItem.BackgroundColorProperty changed callback, map ISwipeItemMenuItem.Background, and refresh text color on iOS/Windows background remap |
✅ PASSED (Gate) | SwipeItem.cs, SwipeItemMenuItemHandler.cs, SwipeItemMenuItemHandler.iOS.cs, SwipeItemMenuItemHandler.Windows.cs, UI test/snapshots |
Original PR |
🔬 Code Review — Deep Analysis
Code Review — PR #36271
Independent Assessment
What this changes: The PR updates SwipeItem background propagation so BackgroundColor changes call Handler.UpdateValue(nameof(ISwipeItemMenuItem.Background)), changes the SwipeItemMenuItemHandler mapper key from IView.Background to ISwipeItemMenuItem.Background, and refreshes text color after background mapping on iOS and Windows.
Inferred motivation: SwipeItem.BackgroundColor can be theme-bound; when the app theme changes, the bindable property changes but the native swipe item background was not remapped.
Reconciliation with PR Narrative
Author claims: GitHub PR narrative was unavailable because gh is not authenticated in this environment. The local issue/test names identify the target bug as "SwipeItemView and SwipeItem background doesn't update on AppTheme change (Light/Dark)".
Agreement/disagreement: The local diff and gate result agree with the inferred bug: the added UI test fails without the fix and passes with it on Android.
Prior Review Reconciliation
No prior ❌ Error findings found locally. GitHub review/comment surfaces were unavailable because gh is not authenticated.
Blast Radius Assessment
- Runs for all instances: yes — mapper/property propagation affects every
SwipeItemhandled bySwipeItemMenuItemHandler, but only when background changes or the mapper initializes. - Startup impact: low — no new static initialization beyond the mapper key and bindable-property callback.
- Static/shared state: no new mutable shared state.
CI Status
- Required-check result: undetermined —
gh pr checks --requiredcould not run without GitHub authentication. - Classification: undetermined.
- Action taken: capped confidence; the provided gate result is used as local evidence for the targeted Android UI test only.
Findings
No high-confidence ❌ Error findings found on changed lines.
⚠️ Warning — Windows handler change lacks direct test coverage
The PR changes SwipeItemMenuItemHandler.Windows.cs, but the added UI test excludes Windows because SwipeView automation is unavailable on Windows. This is a coverage gap rather than a concrete correctness issue.
💡 Suggestion — Consider lower-level mapper coverage
A unit-level or handler-level test for SwipeItem.BackgroundColorProperty -> ISwipeItemMenuItem.Background mapper propagation could reduce reliance on screenshot UI tests if the existing test infrastructure can observe the mapper call without platform UI automation.
Failure-Mode Probing
- AppThemeBinding background change while SwipeView is open: the
BackgroundColorPropertycallback now callsUpdateValue(nameof(ISwipeItemMenuItem.Background)), which maps the native background. - Computed text color after background change: iOS and Windows refresh
ITextStyle.TextColorafter mapping background; Android already recomputes text color insideMapBackground. - Null/default background: existing platform behavior generally does not clear previously inferred text color when
GetTextColor()returns null; this is not introduced by the PR. - Windows behavior: code path changed but is not covered by the new UI test.
Verdict: NEEDS_DISCUSSION
Confidence: medium for code correctness, low for merge readiness because GitHub PR metadata and required CI checks were unavailable.
Summary: The implementation appears aligned with the root cause and the targeted gate passed on Android. The main unresolved concern is coverage/verification breadth, especially Windows.
🛠️ Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix-1 | Controls mapper bridge maps SwipeItem.BackgroundColor to existing IView.Background mapper |
✅ PASS | 1 file | Passed Android after compile-fix iteration; not clearly better because it omits PR iOS/Windows text-color refresh behavior |
| 2 | try-fix-2 | Subscribe to app requested-theme changes and invalidate background/text-color mapper keys | ❌ FAIL | 1 file | Screenshot still differed by 1.31%; theme event is too indirect and narrower than property change |
| 3 | try-fix-3 | Source callback invalidates both background and text color on every platform | ❌ FAIL | 2 files | Screenshot still differed by 1.31%; standalone text-color update disturbed Android's existing contrast-color path |
| 4 | try-fix-4 | Source callback invalidates background and invalidates text color only for iOS/MacCatalyst/Windows | ✅ PASS | 2 files | Passed Android after guard fix, but expert review found it not demonstrably better because it moves platform-specific behavior into shared Controls code |
| PR | PR #36271 | SwipeItem.BackgroundColorProperty callback + mapper key correction to ISwipeItemMenuItem.Background + iOS/Windows text-color refresh in platform MapBackground |
✅ PASSED (Gate) | 4 implementation files + UI test/snapshots | Original PR; best balance after exploration |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| maui-expert-reviewer | 1 | Yes | Candidate 1: Controls mapper bridge |
| maui-expert-reviewer | 2 | Yes | Candidate 2: app theme-change invalidation; failed because the exact property-change signal is needed |
| maui-expert-reviewer | 3 | Yes | Candidate 3: source-level dependent-property invalidation; failed because Android must not receive standalone text-color invalidation |
| maui-expert-reviewer | 4 | Yes | Candidate 4: platform-scoped source-level text-color invalidation; passed Android but was not better than PR after expert review |
| maui-expert-reviewer | Final | No | NO NEW IDEAS |
Exhausted: Yes
Selected Fix: PR #36271 — The PR fix is the best candidate found. Candidate 1 and 4 passed Android, but neither is demonstrably better across the full platform blast radius. Candidate 2 and 3 failed the Android regression test.
📝 Recommended PR Title & Description
Assessment: ✏️ Recommend updating — the current metadata describes the raw background/text-color fix, but the winning fix also refreshes implicit FontImageSource tint and the title can be more searchable.
Recommended title
[All] SwipeView: Update SwipeItem background on AppTheme change
Recommended description
### Issue Details
SwipeItem BackgroundColor with AppThemeBinding does not update when the app theme changes between light and dark modes.
### Root Cause
`SwipeItem.BackgroundColorProperty` had no `propertyChanged` callback, so a theme-triggered value change never notified the handler. Additionally, `SwipeItemMenuItemHandler`'s property mapper was keyed on `IView.Background` instead of `ISwipeItemMenuItem.Background`, so `UpdateValue` calls for that property never matched the mapper entry.
Background changes also affect derived visual state: SwipeItem text color, and implicit `FontImageSource` icon tint when the font icon has no explicit `Color`, are computed from `GetTextColor()` based on the current background.
### Description of Change
Added a `propertyChanged` callback on `BackgroundColorProperty` that calls `Handler?.UpdateValue(nameof(ISwipeItemMenuItem.Background))`, and corrected the `SwipeItemMenuItemHandler` mapper key to `ISwipeItemMenuItem.Background` so the update reaches `MapBackground`.
Updated iOS and Windows `MapBackground` to refresh `ITextStyle.TextColor` after the background changes, matching Android's existing background-derived text-color behavior. Also refreshes the Source mapper for implicit-color `FontImageSource` icons so their derived tint updates when the background changes, while avoiding unnecessary reloads for PNG/SVG icons or explicitly colored font icons.
Validated the behavior in the following platforms
- [x] Android
- [ ] Windows
- [x] iOS
- [x] Mac
### Issues Fixed
Fixes #31917
### Output ScreenShot
|Before|After|
|--|--|
| <video src="https://github.com/user-attachments/assets/1f9b95cd-56ab-413b-b70e-1f094b105d00" >| <video src="https://github.com/user-attachments/assets/d3748379-8443-424e-ad0d-2e307d94eade">|
🏁 Report — Final Recommendation
Comparative Report — PR #36271
Candidate ranking
| Rank | Candidate | Regression result | Assessment |
|---|---|---|---|
| 1 | pr-plus-reviewer |
Not independently re-run; logically preserves the PR gate behavior because the added Source refresh is guarded to implicit font icons and the provided Android gate scenario has no icon source | Best overall. Keeps the PR's exact property-change signal, mapper-key correction, and iOS/Windows platform-local text-color refresh, while also addressing the expert-found stale implicit FontImageSource tint dependency. |
| 2 | pr |
✅ PASSED gate | Correctly fixes the reported background update and aligns the mapper key, but leaves a real dependent-property gap for implicit font-icon tint after background/theme changes. |
| 3 | try-fix-4 |
✅ PASS | Functionally close to the PR for the tested Android scenario, but pushes platform-specific text-color dependency knowledge into shared Controls code via platform #ifs. The PR's platform handler approach is cleaner. |
| 4 | try-fix-1 |
✅ PASS | Minimal bridge from SwipeItem.BackgroundColor to the existing IView.Background mapper. It passed Android but leaves the mapper keyed to the less-specific interface and omits the PR's iOS/Windows text-color refresh behavior. |
| 5 | try-fix-3 |
❌ FAIL | Uses the exact property-change signal but invalidates text color on every platform; Android failed because standalone text-color invalidation disturbed Android's existing background/contrast path. Failed candidates must rank below passing candidates. |
| 6 | try-fix-2 |
❌ FAIL | Theme-event subscription is too indirect and only covers theme changes, not arbitrary BackgroundColor updates. Failed candidates must rank below passing candidates. |
Winner
Winner: pr-plus-reviewer
pr-plus-reviewer is the strongest candidate because it is the PR fix plus the expert reviewer's actionable dependency fix. It retains the proven, narrow BackgroundColorProperty callback and corrected ISwipeItemMenuItem.Background mapper key, keeps platform-specific text-color refresh in platform handlers, and adds the missing dependent Source refresh only when an implicit-color FontImageSource needs retinting from the new background.
Notes
- The raw PR fix passed the provided Android gate, and the gate should not be re-run per instruction.
pr-plus-reviewerwas applied in a sandbox worktree. A targeted no-restore compile check was blocked by missingproject.assets.jsonin that sandbox, so full CI remains required.- GitHub PR comments/reviews/checks could not be queried because
ghis unauthenticated in this environment.
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
Bring in the SwipeItem AppTheme fix from dotnet#36271 so raw-head review runs include the current base behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bbcdaa9d-d75a-4e3b-b375-cf827a689644
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details SwipeItem BackgroundColor with AppThemeBinding does not update when app theme changes between light and dark modes. ### Root Cause SwipeItem.BackgroundColorProperty` had no `propertyChanged` callback, so a theme-triggered value change never notified the handler. Additionally, `SwipeItemMenuItemHandler`'s property mapper was keyed on `IView.Background` instead of `ISwipeItemMenuItem.Background`, so `UpdateValue` calls for that property never matched the mapper entry ### Description of Change Added a `propertyChanged` callback on `BackgroundColorProperty` that calls `Handler?.UpdateValue(nameof(ISwipeItemMenuItem.Background))`, and corrected the `SwipeItemMenuItemHandler` mapper key to `ISwipeItemMenuItem.Background` so the update now reaches `MapBackground`. Validated the behavior in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #31917 ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/1f9b95cd-56ab-413b-b70e-1f094b105d00" >| <video src="https://github.com/user-attachments/assets/d3748379-8443-424e-ad0d-2e307d94eade">|
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details SwipeItem BackgroundColor with AppThemeBinding does not update when app theme changes between light and dark modes. ### Root Cause SwipeItem.BackgroundColorProperty` had no `propertyChanged` callback, so a theme-triggered value change never notified the handler. Additionally, `SwipeItemMenuItemHandler`'s property mapper was keyed on `IView.Background` instead of `ISwipeItemMenuItem.Background`, so `UpdateValue` calls for that property never matched the mapper entry ### Description of Change Added a `propertyChanged` callback on `BackgroundColorProperty` that calls `Handler?.UpdateValue(nameof(ISwipeItemMenuItem.Background))`, and corrected the `SwipeItemMenuItemHandler` mapper key to `ISwipeItemMenuItem.Background` so the update now reaches `MapBackground`. Validated the behavior in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #31917 ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/1f9b95cd-56ab-413b-b70e-1f094b105d00" >| <video src="https://github.com/user-attachments/assets/d3748379-8443-424e-ad0d-2e307d94eade">|
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details SwipeItem BackgroundColor with AppThemeBinding does not update when app theme changes between light and dark modes. ### Root Cause SwipeItem.BackgroundColorProperty` had no `propertyChanged` callback, so a theme-triggered value change never notified the handler. Additionally, `SwipeItemMenuItemHandler`'s property mapper was keyed on `IView.Background` instead of `ISwipeItemMenuItem.Background`, so `UpdateValue` calls for that property never matched the mapper entry ### Description of Change Added a `propertyChanged` callback on `BackgroundColorProperty` that calls `Handler?.UpdateValue(nameof(ISwipeItemMenuItem.Background))`, and corrected the `SwipeItemMenuItemHandler` mapper key to `ISwipeItemMenuItem.Background` so the update now reaches `MapBackground`. Validated the behavior in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #31917 ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/1f9b95cd-56ab-413b-b70e-1f094b105d00" >| <video src="https://github.com/user-attachments/assets/d3748379-8443-424e-ad0d-2e307d94eade">|
…ross platforms (#35632)" (#36887) <!-- 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! > Supersedes #36883, which was branched off `main` while targeting `inflight/candidate`. That mismatch dragged in 42 unrelated `main`-only commits and produced four spurious conflicts in files that have nothing to do with `SwipeItem`. This branch is built directly on `inflight/candidate`, so it is a clean single-commit diff. ### Issue Details This reverts #35632 ("Fix SwipeItem IconImageSource color handling and rendering across platforms") from the .NET 10 servicing line. #35632 stopped auto-tinting `SwipeItem.IconImageSource` for PNG/SVG sources, so those icons now render in their own colors instead of a contrast color derived from the item background. It shipped in 10.0.90 (SR9) and is causing #36766 — an SVG icon whose fill is `#212121` now renders black on a black swipe item in dark mode, i.e. effectively invisible. The change is a reasonable direction, but it is too breaking for a servicing release: - **It removes a legibility guarantee with no replacement.** `GetTextColor()` picks white or black from background luminosity. #35632 removed that for PNG/SVG but left it in place for the item's label text, so the text is still contrast-corrected while the icon is not. - **There is no opt-in.** #23074 was labelled `proposal/open` and asked for *more configuration*; what shipped was a behavior change with none. An affected app's only options today are pinning to 10.0.80 or re-authoring every SVG per theme. - **It compounds with #36271** (also SR9), which makes `BackgroundColor` correctly follow `AppThemeBinding`. Before SR9 the stale light background accidentally preserved contrast; together the two changes produce black-on-black. - **The prior behavior was the Xamarin.Forms behavior**, not an inconsistency — Xamarin tinted every icon unconditionally on both Android ([`SwipeViewRenderer.cs#L858`](https://github.com/xamarin/Xamarin.Forms/blob/main/Xamarin.Forms.Platform.Android/Renderers/SwipeViewRenderer.cs#L858)) and iOS ([`SwipeViewRenderer.cs#L713`](https://github.com/xamarin/Xamarin.Forms/blob/main/Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs#L713)). ### Description of Change `git revert` of c78acfe, restoring the previous behavior on all platforms: - **Android** — `SetColorFilter(GetTextColor(), SrcAtop)` applied to every drawable again - **iOS/Mac** — `AlwaysTemplate` rendering mode on every image again, with `TintColor = fontImageSource.Color ?? GetTextColor()` - **Windows** — `MapSourceAsync` back to `ToIconSource()` (`BitmapIconSource`, whose `ShowAsMonochrome` defaults to `true`); the `LoadFileIconAsync` helper is removed The `Issue23074` host-app page, shared test, `cancel_red.svg` and the `SwipeItemFontAndSvgIconsRenderCorrectly` snapshots are removed with it, and the SwipeView snapshots are restored to their pre-#35632 baselines. The revert is scoped strictly to #35632. `MapVisibility` on the Windows handler — added on `inflight/candidate` after #35632 — is untouched. **Conflict resolution note:** `TestCases.iOS.Tests/snapshots/ios/VerifyCollectionViewContentWithIconImageSwipeItem.png` conflicted because #36202 re-saved it for iOS 18 after #35632 landed. That test's swipe item has `BackgroundColor = #6A5ACD` (luminosity ≈ 0.40 → white), so with this revert `groceries.png` is tinted solid white again and the pre-#35632 baseline is the correct content. If iOS 18 CI shows drift unrelated to the tint, this one snapshot may need a re-save from the CI artifact. ### Follow-up The behavior change itself is good and should ship — just in .NET 11 rather than servicing, paired with an explicit opt-in API so users get a real migration path instead of a silent rendering change in a patch release. That is #36884, which keeps the #35632 behavior and adds `SwipeItem.IconColor`. ### Issues Fixed Fixes #36766 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cb2a11ab-30ba-4020-836a-3acccb5f58cc
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details SwipeItem BackgroundColor with AppThemeBinding does not update when app theme changes between light and dark modes. ### Root Cause SwipeItem.BackgroundColorProperty` had no `propertyChanged` callback, so a theme-triggered value change never notified the handler. Additionally, `SwipeItemMenuItemHandler`'s property mapper was keyed on `IView.Background` instead of `ISwipeItemMenuItem.Background`, so `UpdateValue` calls for that property never matched the mapper entry ### Description of Change Added a `propertyChanged` callback on `BackgroundColorProperty` that calls `Handler?.UpdateValue(nameof(ISwipeItemMenuItem.Background))`, and corrected the `SwipeItemMenuItemHandler` mapper key to `ISwipeItemMenuItem.Background` so the update now reaches `MapBackground`. Validated the behavior in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #31917 ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/1f9b95cd-56ab-413b-b70e-1f094b105d00" >| <video src="https://github.com/user-attachments/assets/d3748379-8443-424e-ad0d-2e307d94eade">|
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details SwipeItem BackgroundColor with AppThemeBinding does not update when app theme changes between light and dark modes. ### Root Cause SwipeItem.BackgroundColorProperty` had no `propertyChanged` callback, so a theme-triggered value change never notified the handler. Additionally, `SwipeItemMenuItemHandler`'s property mapper was keyed on `IView.Background` instead of `ISwipeItemMenuItem.Background`, so `UpdateValue` calls for that property never matched the mapper entry ### Description of Change Added a `propertyChanged` callback on `BackgroundColorProperty` that calls `Handler?.UpdateValue(nameof(ISwipeItemMenuItem.Background))`, and corrected the `SwipeItemMenuItemHandler` mapper key to `ISwipeItemMenuItem.Background` so the update now reaches `MapBackground`. Validated the behavior in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #31917 ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/1f9b95cd-56ab-413b-b70e-1f094b105d00" >| <video src="https://github.com/user-attachments/assets/d3748379-8443-424e-ad0d-2e307d94eade">|
<!-- 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! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details SwipeItem BackgroundColor with AppThemeBinding does not update when app theme changes between light and dark modes. ### Root Cause SwipeItem.BackgroundColorProperty` had no `propertyChanged` callback, so a theme-triggered value change never notified the handler. Additionally, `SwipeItemMenuItemHandler`'s property mapper was keyed on `IView.Background` instead of `ISwipeItemMenuItem.Background`, so `UpdateValue` calls for that property never matched the mapper entry ### Description of Change Added a `propertyChanged` callback on `BackgroundColorProperty` that calls `Handler?.UpdateValue(nameof(ISwipeItemMenuItem.Background))`, and corrected the `SwipeItemMenuItemHandler` mapper key to `ISwipeItemMenuItem.Background` so the update now reaches `MapBackground`. Validated the behavior in the following platforms - [x] Android - [ ] Windows - [x] iOS - [x] Mac ### Issues Fixed Fixes #31917 ### Output ScreenShot |Before|After| |--|--| | <video src="https://github.com/user-attachments/assets/1f9b95cd-56ab-413b-b70e-1f094b105d00" >| <video src="https://github.com/user-attachments/assets/d3748379-8443-424e-ad0d-2e307d94eade">|
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
SwipeItem BackgroundColor with AppThemeBinding does not update when app theme changes between light and dark modes.
Root Cause
SwipeItem.BackgroundColorProperty
had nopropertyChangedcallback, so a theme-triggered value change never notified the handler. Additionally,SwipeItemMenuItemHandler's property mapper was keyed onIView.Backgroundinstead ofISwipeItemMenuItem.Background, soUpdateValue` calls for that property never matched the mapper entryDescription of Change
Added a
propertyChangedcallback onBackgroundColorPropertythat callsHandler?.UpdateValue(nameof(ISwipeItemMenuItem.Background)), and corrected theSwipeItemMenuItemHandlermapper key toISwipeItemMenuItem.Backgroundso the update now reachesMapBackground.Validated the behavior in the following platforms
Issues Fixed
Fixes #31917
Output ScreenShot
31917-BeforeFix.mov
31917-AfterFix.mov