Fix Shell flyout item template does not update selected visuals after DynamicResource changes#35155
Fix Shell flyout item template does not update selected visuals after DynamicResource changes#35155devanathan-vaithiyanathan wants to merge 13 commits into
Conversation
|
/azp run maui-pr-uitests , maui-pr-devicetests |
There was a problem hiding this comment.
Pull request overview
Fixes a Shell flyout ItemTemplate issue where selected-item visuals (e.g., background color driven by DynamicResource) can become stale after resource updates, especially with recycled cells.
Changes:
- Core: add an internal
VisualStateManager.GoToState(..., force: true)path to allow reapplying the current visual state. - Platform flyout rendering: listen for resource changes and reapply the current visual state (Android/iOS/Windows) while cleaning up listeners during recycling/context changes.
- Tests: add HostApp repro page (Issue34931) + Appium UITest with screenshot verification.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/Controls/src/Core/VisualStateManager.cs |
Adds force support to reapply a visual state even when the requested state name matches the current state. |
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cs |
Updates recycled flyout view holders to manage resource listeners and force visual-state reapply on resource changes. |
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerCell.cs |
Adds resource-change listening for the flyout cell’s view and forces visual-state reapply when resources change. |
src/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutItemView.cs |
Adds resource-change listening and forces visual-state reapply on Windows flyout item views during context changes. |
src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml |
Adds a Shell ItemTemplate using DynamicResource + visual states to reproduce the stale-selected-visual issue. |
src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs |
Initializes dynamic resource values and provides pages used by the repro Shell. |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34931.cs |
Adds an Appium UITest that exercises navigation/resource changes and verifies selected visuals via screenshot. |
Comments suppressed due to low confidence (2)
src/Controls/src/Core/VisualStateManager.cs:120
- The null-check for
targetis duplicated. Sincetargetis already checked for null a few lines above, the secondif (target == null)block is unreachable and should be removed to avoid dead code.
if (target == null)
{
continue;
}
src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerCell.cs:124
- The PR description says iOS listens for resource changes from both the cell view and its BindingContext, but this code only registers a
ResourcesChangedlistener onView(via_viewResource). If BindingContext resources are also intended to trigger a visual-state refresh, consider adding/removing a listener whenBindingContextchanges (or update the PR description if only the view listener is required).
if (_bindingContext != null && _bindingContext is BaseShellItem baseShell)
baseShell.PropertyChanged -= OnElementPropertyChanged;
_bindingContext = value;
View.BindingContext = value;
if (_bindingContext != null && _bindingContext is BaseShellItem baseShell2)
{
baseShell2.PropertyChanged += OnElementPropertyChanged;
UpdateVisualState();
}
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 7 findings
See inline comments for details.
|
/review -b feature/enhanced-reviewer -p android |
kubaflo
left a comment
There was a problem hiding this comment.
Could you check the ai's suggestions?
|
/review -b feature/enhanced-reviewer -p android |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
|
|
||
| static class Issue34931ViewExtensions | ||
| { | ||
| public static T Assign<T>(this T view, out T assigned) |
There was a problem hiding this comment.
[critical] Build correctness — This adds another generic Assign extension method in the Maui.Controls.Sample.Issues namespace, but Issue34583ViewExtensions already defines Assign<TView>(this TView, out TView). Calls such as new Button { ... }.Assign(...) are now applicable to both helpers, producing CS0121 and preventing the HostApp UI test project from compiling. Reuse the existing helper, rename this helper, or avoid adding a namespace-wide extension method.
|
@kubaflo , |
|
/review -b feature/enhanced-reviewer -p android |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 2 findings
See inline comments for details.
| NavigateWithFlyout("Second", "Issue34931SecondPageLabel"); | ||
| NavigateWithFlyout("Third", "Issue34931ThirdPageLabel"); | ||
| NavigateWithFlyout("Home", "ChangeColorButton"); | ||
| App.Tap("ChangeColorButton"); |
There was a problem hiding this comment.
[major] Regression Prevention — This second tap toggles Primary back to the initial color before the screenshot is taken. A broken implementation that leaves the selected flyout item stuck on the original color can still pass the screenshot, so the test does not prove the selected visual refreshed to the updated DynamicResource. Keep the resource at #FF6347, or change to a third distinct color and assert/snapshot that color.
| App.Tap("ChangeColorButton"); | ||
| App.TapShellFlyoutIcon(); | ||
| App.WaitForElement("Third"); | ||
| VerifyScreenshot(); |
There was a problem hiding this comment.
[major] Regression Prevention — The raw PR adds VerifyScreenshot() but does not commit the required screenshot baselines for the platforms where this test is compiled. Missing baselines will fail CI or only produce comparison artifacts instead of protecting the regression. Commit the applicable baselines, or replace this with a deterministic visual/color assertion.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@devanathan-vaithiyanathan — new AI review results are available based on this last commit:
19e3b8f. 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: ❌ FAILED
Platform: ANDROID · Base: main · Merge base: bb4e7040
🩺 Fix does not compile — applying the PR's fix produces a build error before tests can run. The earlier-than-test failure is the root cause; the per-test ❌ FAIL marks are downstream effects, not real test failures.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Ass...
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue34931 Issue34931 |
🛠️ BUILD ERROR | 🛠️ BUILD ERROR |
🔴 Without fix — 🖥️ Issue34931: 🛠️ BUILD ERROR · 1303s
(truncated to last 15,000 chars)
HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
5 Error(s)
Time Elapsed 00:06:33.98
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.90-ci+azdo.14376908
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
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
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
5 Error(s)
Time Elapsed 00:06:39.93
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.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.90-ci+azdo.14376908
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
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
5 Error(s)
Time Elapsed 00:06:37.62
🟢 With fix — 🖥️ Issue34931: 🛠️ BUILD ERROR · 1033s
(truncated to last 15,000 chars)
HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
5 Error(s)
Time Elapsed 00:06:41.03
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.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.90-ci+azdo.14376908
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
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
5 Error(s)
Time Elapsed 00:04:28.39
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.90-ci+azdo.14376908
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
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.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
##vso[build.updatebuildnumber]10.0.90-ci+azdo.14376908
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
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.90-ci+azdo.14376908
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(78,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(83,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(88,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34583.cs(93,11): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Assign<TView>(TView, out TView)' and 'Issue34931ViewExtensions.Assign<T>(T, out T)' [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
5 Error(s)
Time Elapsed 00:04:26.42
⚠️ Failure Details
- 🛠️ Issue34931 without fix: build failed before tests could run
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Ass...
- 🛠️ Issue34931 with fix: build failed (fix does not compile)
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs(69,8): error CS0121: The call is ambiguous between the following methods or properties: 'Issue34583ViewExtensions.Ass...
📁 Fix files reverted (5 files)
eng/pipelines/ci-copilot.ymlsrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerCell.cssrc/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutItemView.cssrc/Controls/src/Core/VisualStateManager.cs
UI Tests
Full UI test matrix will run (no specific categories detected from PR changes).
Pre-Flight — Context & Validation
Issue: #34931 - Shell flyout item template does not update selected visuals after DynamicResource changes
PR: #35155 - Fix Shell flyout selected DynamicResource visual refresh
Platforms Affected: Android, iOS/MacCatalyst, Windows
Files Changed: 4 implementation, 3 test
Key Findings
- GitHub CLI/API context was unavailable because
ghis unauthenticated in this environment; issue/PR narrative was supplemented from local branch evidence and public issue search. - The PR changes Shell flyout item rendering on Android, iOS/MacCatalyst, and Windows to reapply the current VisualState when resource changes fire, using a new internal forced
VisualStateManager.GoToStatepath. - The added regression test targets issue #34931 and is a UI test; impacted UI category is Shell.
- Prior gate result was provided as failed and was not rerun. The independent code-review step identified the likely PR-caused compile blocker: a duplicate generic
Assign<T>extension in the HostApp issue namespace.
Code Review Summary
Verdict: NEEDS_CHANGES
Confidence: low
Errors: 1 | Warnings: 1 | Suggestions: 0
Key code review findings:
- ❌
src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs:150addsAssign<T>(this T view, out T assigned)inMaui.Controls.Sample.Issues, conflicting with an existingIssue34583ViewExtensions.Assign<TView>extension in the same namespace and causing ambiguous extension-method resolution forButton/Viewcalls. ⚠️ src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34931.cs:1excludes the regression test on Windows while the PR changes Windows Shell flyout code.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #35155 | Reapply Shell flyout item VisualState on DynamicResource changes by adding an internal forced VSM transition and platform resource-change listeners. | ❌ FAILED (Gate) | VisualStateManager.cs, Shell flyout platform handlers, Issue34931 UI test files |
Original PR; gate failure attributed to duplicate test helper compile ambiguity. |
Code Review — Deep Analysis
Code Review — PR #35155
Independent Assessment
What this changes: Reapplies Shell flyout item VisualStates when DynamicResource values change by adding an internal forced VisualStateManager.GoToState path and platform resource-change listeners for Android, iOS, and Windows flyout item-template views. Adds a UI regression test.
Inferred motivation: Selected Shell flyout items can keep stale colors after runtime resource changes because VSM no-ops when asked to enter the already-current state.
Reconciliation with PR Narrative
Author claims: Fixes Shell flyout selected visuals after DynamicResource changes across Android/iOS/Windows/Mac, with Issue34931 UI coverage.
Agreement/disagreement: The implementation matches the intended mechanism. However, the added HostApp test code currently introduces a compile-breaking extension-method ambiguity.
Prior Review Reconciliation
| Prior ❌ Error Finding | Source | Status | Evidence |
|---|---|---|---|
Duplicate Assign<T> extension causes CS0121 build failure |
MauiBot review / gate | ❌ Unresolved | Current Issue34931.xaml.cs:150-157 still defines Assign<T>, while existing Issue34583.cs:281-286 defines another applicable Assign<TView> in the same namespace. Calls like Issue34931.xaml.cs:69 are ambiguous. |
Blast Radius Assessment
- Runs for all instances: No; scoped to Shell flyout item template rendering, but across Android/iOS/Windows Shell flyouts.
- Startup impact: No direct startup path; runs when Shell flyout cells/views are created or rebound.
- Static/shared state: No new static mutable state. Shared VSM behavior adds an internal overload; existing public
GoToStateremains unchanged.
CI Status
- Required-check result:
gh pr checks --requiredunavailable because GitHub CLI is unauthenticated. Public check-runs for head19e3b8fshow failures includingBuild Analysis,maui-pr-uitests, andmaui-pr-devicetests. - Classification: PR-caused failure ❌ — prior gate logs show CS0121 compiler errors from the new
Assign<T>helper. - Action taken: Invoked
azdo-build-investigatorcontext; confidence capped low due red/undetermined required CI.
Findings
❌ Error — New Assign<T> extension breaks HostApp compilation
src/Controls/tests/TestCases.HostApp/Issues/Issue34931.xaml.cs:150-157 adds a namespace-level generic extension method:
public static T Assign<T>(this T view, out T assigned)
where T : BindableObjectThe same namespace already contains Issue34583ViewExtensions.Assign<TView>(this TView view, out TView assigned) where TView : View. For Button and other View instances, both extensions are applicable, so calls such as Issue34931.xaml.cs:69 become ambiguous (CS0121). This matches the prior gate failure and blocks the UI test HostApp build.
⚠️ Warning — Windows-specific fix has no automated Windows coverage
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34931.cs:1 excludes the regression test on Windows via #if TEST_FAILS_ON_WINDOWS, while the PR changes src/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutItemView.cs. If Windows UI automation cannot cover this path, a lower-level test or documented manual validation would help.
Failure-Mode Probing
- Duplicate extension with unrelated issue tests: Any HostApp build compiling both issue files sees both extension methods in
Maui.Controls.Sample.Issues, so the failure is not platform-specific. - DynamicResource update while selected state unchanged:
force: truebypasses the current-state no-op and reapplies setters, which addresses the stale selected visual. - Handler/cell recycling: Android and iOS remove listeners on reassignment/disconnect; Windows removes on data-context changes. No duplicate subscription was found for normal rebinding.
Verdict: NEEDS_CHANGES
Confidence: low
Summary: The core VSM/resource-refresh approach appears sound, but the PR cannot merge because the new test helper causes a concrete compile failure. Fix or remove the duplicate Assign<T> extension, then rerun CI.
Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix | Remove duplicate Assign<T> extension helper from Issue34931.xaml.cs and use an explicit local Button variable. |
❌ Failed | 1 file | Build/deploy succeeded; UI test failed because Android screenshot baseline was missing. |
| 2 | try-fix | Runtime-layer experiment: reapply AppThemeBinding when active value is a changed nested DynamicResource. |
❌ Failed | 2 files during experiment | Build/deploy succeeded; same missing-baseline failure. Broader risk than Shell-scoped PR fix; reverted. |
| 3 | try-fix | Keep PR runtime fix + candidate 1 compile fix, and add the generated Android visual baseline. | ✅ Passed | 2 files | Android HostApp build/deploy succeeded; Issue34931 UI test passed. |
| PR | PR #35155 | Force reapply current Shell flyout VisualState on DynamicResource changes via internal VSM overload and platform resource-change listeners. | ❌ FAILED (Gate) | 7 files | Original PR runtime approach appears sound, but gate failed due test compile ambiguity and missing Android baseline. |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| gpt-5.5 / maui-expert-reviewer | 1 | Yes | Remove the duplicate test helper extension; smallest merge-readiness fix for the concrete gate compile blocker. |
| gpt-5.5 / maui-expert-reviewer | 2 | Yes | Explore AppThemeBinding nested DynamicResource reapply as a runtime alternative to forced VSM. |
| gpt-5.5 / maui-expert-reviewer | 3 | Yes | Add the missing Android visual baseline because the remaining failure was test artifact completeness, not runtime behavior. |
Exhausted: Yes — after one targeted compile/test fix, one broader runtime alternative, and one test-artifact completion candidate, no further meaningful Android-specific alternatives were indicated by the observed failures.
Selected Fix: Candidate #3 — It is the only candidate that passes the Android validation. It should be treated as a supplement to the PR's runtime fix rather than a replacement: keep the PR's Shell/VSM runtime approach, remove the duplicate Assign<T> helper, and add the Android visual baseline.
Report — Final Recommendation
Comparative Report — PR #35155
Candidate ranking
| Rank | Candidate | Android result | Assessment |
|---|---|---|---|
| 1 | pr-plus-reviewer |
Not rerun after reviewer feedback | Best candidate. Keeps the PR's Shell-scoped runtime fix, incorporates the STEP 5a compile fix, and addresses the expert reviewer's major test-flow issue by keeping Primary at the updated value during visual verification. Needs a regenerated updated-color screenshot baseline if the screenshot assertion remains. |
| 2 | try-fix-3 |
✅ Passed | Only recorded candidate with a passing Android run. It fixes the HostApp compile ambiguity and adds the missing Android baseline, but expert review found the test toggles back to the original color before verification, so the pass does not strongly prove the DynamicResource-selected visual regression. |
| 3 | try-fix-1 |
❌ Failed | Correctly removes the duplicate Assign<T> compile blocker, but the Android UI run failed because the screenshot baseline was missing. Per the rule, this failed candidate ranks below passing candidates. |
| 4 | try-fix-2 |
❌ Failed | Explores a broader AppThemeBinding/nested DynamicResource runtime alternative, but it still failed on the missing baseline and has higher blast radius than the Shell-scoped PR approach. Per the rule, this failed candidate ranks below passing candidates. |
| 5 | pr |
❌ Failed gate | Raw PR fix has a plausible runtime approach, but the gate failed with CS0121 from the duplicate Assign<T> extension and the expert reviewer found major test reliability gaps. |
Winning candidate
Winner: pr-plus-reviewer
This is the best overall path because it preserves the PR's localized Shell/VSM production fix while combining the successful STEP 5a compile correction with the expert reviewer's test-validity correction. try-fix-3 is the only empirically passing candidate, but its pass is weakened by the reviewer finding that the test can return to the initial color before taking the screenshot; failed candidates remain ranked below the passing candidate as required.
Notes for follow-up
- Do not merge the raw
prcandidate as-is; it fails Android gate compilation. - If keeping screenshot verification in
pr-plus-reviewer, regenerate and commit the platform baselines for the corrected updated-color state. - The broader
try-fix-2resource-layer approach should not be preferred unless a separate issue proves this is not Shell-specific.
Future Action — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
kubaflo
left a comment
There was a problem hiding this comment.
Could you please check the ai's suggestions?

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 whether this change resolves your issue. Thank you!
Issue Details
Flyout items were keeping the old selected background color after selection changed, especially with DynamicResource colors and recycled cells.
Description of Change
Core: Added a forced visual-state reapply path in VisualStateManager so controls can re-enter the current state when resource values change, instead of no-oping when the requested state name matches the active state.
iOS: Updated UIContainerCell.cs to listen for resource changes from both the cell view and its binding context, and to force the selected visual state to refresh when those resources change.
Android: Updated ShellFlyoutRecyclerAdapter.cs so recycled flyout view holders detach listeners from the previous item, attach to the new item, and reapply the current visual state when DynamicResource values change.
Windows: Updated ShellFlyoutItemView.cs to correctly manage resource listeners during context changes and to force the visual state to reapply after relevant resource updates.
Issues Fixed
Fixes #34931
Tested the behavior in the following platforms.
Before-fix.mov
After-fix.mov