Skip to content

[automated] Merge branch 'main' => 'net11.0' - #39768

Merged
kubaflo merged 101 commits into
net11.0from
merge/main-to-net11.0
Oct 30, 2026
Merged

kubaflo merged 101 commits into
net11.0from
merge/main-to-net11.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

I detected changes in the main branch which have not been merged yet to net11.0. I'm a robot and am configured to help you automatically keep net11.0 up to date, so I've opened this PR.

This PR merges commits made on main by the following committers:

  • kubaflo
  • sheiksyedm
  • NafeelaNazhir
  • github-actions[bot]

Instructions for merging from UI

This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, not a squash or rebase commit.

merge button instructions

If this repo does not allow creating merge commits from the GitHub UI, use command line instructions.

Instructions for merging via command line

Run these commands to merge this pull request from the command line.

git fetch
git checkout main
git pull --ff-only
git checkout net11.0
git pull --ff-only
git merge --no-ff main

# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge
# Pushing the changes to the PR branch will re-trigger PR validation.
git push https://github.com/dotnet/maui HEAD:merge/main-to-net11.0
or if you are using SSH
git push git@github.com:dotnet/maui HEAD:merge/main-to-net11.0

After PR checks are complete push the branch

git push

Instructions for resolving conflicts

⚠️ If there are merge conflicts, you will need to resolve them manually before merging. You can do this using GitHub or using the command line.

Instructions for updating this pull request

Contributors to this repo have permission update this pull request by pushing to the branch 'merge/main-to-net11.0'. This can be done to resolve conflicts or make other changes to this pull request before it is merged.
The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote.

git fetch
git checkout -b merge/main-to-net11.0 origin/net11.0
git pull https://github.com/dotnet/maui merge/main-to-net11.0
(make changes)
git commit -m "Updated PR with my changes"
git push https://github.com/dotnet/maui HEAD:merge/main-to-net11.0
or if you are using SSH
git fetch
git checkout -b merge/main-to-net11.0 origin/net11.0
git pull git@github.com:dotnet/maui merge/main-to-net11.0
(make changes)
git commit -m "Updated PR with my changes"
git push git@github.com:dotnet/maui HEAD:merge/main-to-net11.0

Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues.
Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.

SubhikshaSf4851 and others added 30 commits October 28, 2026 09:51
…37648)

<!-- Please keep the note below for people who 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 whether this change resolves your
issue. Thank you!

This pull request addresses issues with the accuracy of the `CanGoBack`
and `CanGoForward` properties in the Windows WebView handler, ensuring
that navigation state is correctly reflected and not stale. It also adds
a regression test to prevent future issues with navigation history.

### Description of Change
**Fixes and improvements to WebView navigation state:**

* Updated the logic in `WebViewHandler.Windows.cs` to check
`CoreWebView2.CanGoBack` and `CoreWebView2.CanGoForward` instead of
relying solely on the WebView2 control properties, which could become
stale and cause incorrect navigation behavior.
* Enhanced the `UpdateCanGoBackForward` extension method in
`WebViewExtensions.cs` to prefer the `CoreWebView2` navigation state for
`CanGoBack` and `CanGoForward`, falling back to the control's properties
only when necessary.

**Testing and regression prevention:**

* Added a new test, `CanGoBackIsFalseAfterReturningToFirstPage`, to
verify that `CanGoBack` is set to false after navigating back to the
first page, preventing regressions related to navigation history.


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

### Issues Fixed

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

Fixes #37534 

### Tested the behavior in the following platforms

- [x] Windows
- [ ] Android
- [ ] iOS
- [ ] Mac


| Before Issue Fix | After Issue Fix |
|----------|----------|
| <video
src="https://github.com/user-attachments/assets/c6c4e68b-21ac-49cd-ad96-3f628c889674">
| <video
src="https://github.com/user-attachments/assets/1a0fcee7-32d4-42a6-8003-25b89087e580">
|

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------
…37772)

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
The issue was caused by a small view moved off-screen with TranslationY
for a full-screen Shell navigation animation. This incorrectly preserved
the top safe-area inset, creating the unwanted gap in the bottom sheet.

https://github.com/dotnet/maui/blob/19a188896c0e518c0d201db181f67166c740724d/src/Core/src/Platform/Android/SafeAreaExtensions.cs#L175

On Android, moving a view outside the screen using TranslationY
incorrectly adds top padding to the layout.

<!-- Enter description of the fix in this section -->
Updated Android vertical animation detection to treat only full-screen
views as Shell navigation transitions. Smaller translated controls, are
excluded so they no longer receive incorrect top safe-area padding.

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

Fixes #37418

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

**Tested the behavior in the following platforms.**
- [x] Android
- [ ] Windows
- [x] iOS
- [ ] Mac

| Before  | After  |
|---------|--------|
| **Android**<br> <img
src="https://github.com/user-attachments/assets/9a17e25d-4b59-4d33-9b22-014bb504e3a0"
width="300" height="600"> | **Android**<br> <img
src="https://github.com/user-attachments/assets/aef1bf14-dca6-411f-94e4-c473ac3b5d0c"
width="300" height="600"> |

---------
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…8587)

<!-- 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
On Android with Material 3, an Editor starts at its maximum height
instead of growing as text is entered.

### Root Cause
The Editor was forced to use all available height, changing
MaximumHeightRequest from a limit into its starting height.

### Description of Change
Force the available height only for single-line controls such as Entry,
allowing the multiline Editor to grow with its content.

Validated the behavior in the following platforms
 
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac
 
### Issues Fixed
  
Fixes #37440 

### Output  ScreenShot

|Before|After|
|--|--|
| <img width="363" height="657" alt="image"
src="https://github.com/user-attachments/assets/3dc925f8-5621-44d7-95ea-39b9e3bdd19b"
/> | <img width="363" height="657" alt="image"
src="https://github.com/user-attachments/assets/e085a680-f78c-4ce3-8f83-351569155f74"
/> |
<!-- 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!

### Issue Details
SwipeItemView was retained by a long-lived command through its
CanExecuteChanged event, causing a memory leak.

### Description of Change

<!-- Enter description of the fix in this section -->
Replaced the direct event subscription with MAUI’s existing
WeakCommandSubscription through ICommandElement.

### Issues Fixed

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

Fixes #38177 

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

 **Tested the behavior in the following platforms.**
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac


| Before  | After  |
|---------|--------|
| **Android**<br> <img
src="https://github.com/user-attachments/assets/0ed1f34f-f4c2-45be-88e5-430f417fcdb9"
width="300" height="600"> | **Android**<br> <img
src="https://github.com/user-attachments/assets/e656958b-c414-4fbf-b4d0-a6498a8375de"
width="300" height="600"> |

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

Some refactor and improve the error message for XAML SG.

### Issues Fixed

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

Fixes #38711

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
<!-- 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!

### Issue Details
- Assigning a shared or long-lived TransformCollection to
TransformGroup.Children creates a strong CollectionChanged event
subscription that keeps the TransformGroup and its binding context alive
even after all application references to the group are dropped, causing
a memory leak.

### Root Cause
- A shared TransformCollection strongly retained its TransformGroup
through the CollectionChanged event subscription when Children was never
replaced.

### Description of Change
- The collection subscription now uses a weak proxy with deterministic
and finalizer cleanup, preventing a shared collection from retaining an
unreferenced TransformGroup.
- Updated the public API files to reflect the addition of a finalizer
(~TransformGroup) for TransformGroup on all supported platforms.

### Issues Fixed
Fixes #38717

### Validated the behaviour in the following platforms
- [x] Windows
- [x] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/adb67d0b-c8eb-4cb9-bf55-a8cb51788308">
| <img
src="https://github.com/user-attachments/assets/e314e0e5-25a8-440d-87f4-08e578c1efe2">
|
| Android | <img
src="https://github.com/user-attachments/assets/d5dcfd77-fbbd-4938-b0fd-c64111242aa8">
| <img
src="https://github.com/user-attachments/assets/b57dd07a-8c82-4e85-bf50-0b2f48718b69">
|
| Mac | <img
src="https://github.com/user-attachments/assets/f14456fd-edb9-4372-8723-4badbbf52c29">
| <img
src="https://github.com/user-attachments/assets/d811ec05-3eb0-42b2-8f63-1ad069a6c50a">
|
| Windows | <img
src="https://github.com/user-attachments/assets/20234ae5-e7d7-4489-ab7c-cf41c4e07067">
| <img
src="https://github.com/user-attachments/assets/849a3828-4b1b-4c59-8e66-f5d2977048bb">
|
…ggers attached (#38439)

<!-- 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!
 
### Issue Details

Clearing an attached VisualStateGroupList removes groups without
detaching the state triggers nested inside them. A trigger subscribed to
a shared managed publisher in OnAttached() therefore stays subscribed
and retained after its group is removed.

### Root Cause 

An attached `StateTriggerBase` runs `OnAttached()`, where custom
triggers may subscribe to long-lived publishers such as static events.
They rely on `SendDetached()` invoking `OnDetached()` to unsubscribe.
 
Replacing the entire `VisualStateGroups` attached property already
performed this teardown. However, mutating the existing
`VisualStateGroupList` did not:
 
- `Clear`
- `Remove`
- `RemoveAt`
- Adding a group that replaces one with the same name
- Replacing a group through the indexer
 
These paths only removed `StatesChanged` handlers and collection
entries. Nested triggers remained attached, leaving retention paths such
as:
 
```text
static publisher → event delegate → state trigger → page-local data
```

### Description of Change

Added a shared `DetachGroup` teardown method that:
 
1. Unsubscribes the group's `StatesChanged` handler.
2. Calls `SendDetached()` on every nested state trigger.
3. Removes the group's reference to its associated visual element.
 
All removal and replacement paths in `VisualStateGroupList` now use this
teardown.
 
The `Remove` implementation also identifies the actual stored group
before removing it. This ensures the correct instance is detached even
when another equality-equivalent object is supplied.
 
## Regression coverage
 
Added tests to `VisualStateManagerTests.cs` verifying trigger detachment
for:
 
- `Clear`
- `Remove`
- `RemoveAt`
- Duplicate-name replacement through `Add`
- Index replacement 
 
### Issues Fixed
 
Fixes #38245  
 
**Tested the behavior in the following platforms.**
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
| Before  | After  |
|---------|--------|
| <img width="300" height="600" alt="image"
src="https://github.com/user-attachments/assets/3f5ede16-f0ee-4aac-b728-07835001f851"
/> | <img width="300" height="600" alt="image"
src="https://github.com/user-attachments/assets/dafc0ce1-e9b4-439d-949e-cbe29a29af49"
/> |

---------

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… device rotation (#38771)

<!-- 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. !!!!!!!
-->

### Root cause

The issue occurs because of the cell being arranged too early during the
preferred layout pass when the collection view constraints change during
device rotation. This updates the cached arranged size before
LayoutSubviews receives the final native bounds, which can cause the
layout to skip the required final arrangement and result in incorrect
item positioning or sizing in RTL layouts.

### Solution description

The fix involves deferring the arrangement to LayoutSubviews when the
layout constraints change, such as during device rotation, so the cell
can be arranged using the actual native bounds. At the same time, inline
arrangement is retained for dynamic content changes to preserve the
behavior introduced by the existing CollectionView2 dynamic content fix.

### Regression PR

PR #37437


Validated the behavior in the following platforms
 
- [x] iOS
- [ ] Mac
- [ ] Android
- [ ] Windows
 
### Issues Fixed
  
Fixes #38622

### Output  ScreenShot

|Platform|Before|After|
|--|--|--|
|iOS| <video
src="https://github.com/user-attachments/assets/4c2b5c8f-fd29-40b0-a8f3-5063684dc6fd">|
<video
src="https://github.com/user-attachments/assets/948ef0eb-f31d-47e7-b7a9-509a54680f16">|
…t truncates to 0 (#38814)

<!-- 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

- GeometryHelper can generate invalid `(NaN, NaN)` points when
flattening very small arc, cubic Bézier, or quadratic Bézier segments.
- On Windows, these invalid points can propagate into the Win2D geometry
pipeline and cause `D2DERR_BAD_NUMBER (0x88990011)`, which may terminate
the application.
- On Android, the invalid path typically results in the shape not being
rendered.

### Root Cause

- The flattening algorithms calculate a subdivision count based on the
estimated curve length and the specified tolerance.
- When the curve length is smaller than the tolerance, integer
truncation causes the calculated subdivision count to become `0`.
- The flattening loop still executes once and subsequently uses the
subdivision count as a divisor.
- This results in a `0.0 / 0.0` calculation, producing `NaN`.
- The resulting non-finite point is added to the flattened geometry and
propagated to platform rendering.

### Description of Change

#### Geometry flattening robustness improvements

- Updated `FlattenCubicBezier`, `FlattenQuadraticBezier`, and
`FlattenArc` in `GeometryHelper.cs` to ensure the calculated subdivision
count is never less than `1`.
- This prevents division-by-zero during interpolation and eliminates
generation of `(NaN, NaN)` points for sub-tolerance curves.
- Very small curves are now flattened into the smallest valid
approximation: a single straight chord between the start and end points.

**Unit test enhancements:**

* Added new tests in `GeometryTests.cs`
(`FlattenSmallArcProducesFinitePoints`,
`FlattenSmallCubicBezierProducesFinitePoints`, and
`FlattenSmallQuadraticBezierProducesFinitePoints`) to verify that
flattening small arcs and beziers always results in a finite set of
valid points, specifically checking for exactly two points and that all
coordinates are finite.

### Issues Fixed

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

Fixes #38751 

### Tested the behavior in the following platforms
 
- [x] Windows
- [x] Android
- [ ] iOS
- [ ] Mac

### Output
 
| Before | After |
|----------|----------|
| <img
src="https://github.com/user-attachments/assets/a9c65c2e-951a-4ada-9d7a-f0785f4395b4">
| <img
src="https://github.com/user-attachments/assets/5929a257-c62b-4da0-9189-a737bbf0a052">
|

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
<!-- 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
AddHandler can cause IMauiHandlersCollection objects and their
registered services to stay in memory, resulting in a memory leak.

### Root Cause
A static ConcurrentDictionary keeps the handler collection as a strong
reference, so it cannot be garbage-collected.

### Description of Change

Replaced ConcurrentDictionary with ConditionalWeakTable in
RegisteredHandlerServiceTypeSet to ensure that IMauiHandlersCollection
instances can be garbage collected when no longer referenced, reducing
the risk of memory leaks.

Validated the behavior in the following platforms
 
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
 
### Issues Fixed
  
Fixes #38671 

### Output  ScreenShot

|Before|After|
|--|--|
| <img width="700" height="284" alt="image"
src="https://github.com/user-attachments/assets/d31d91b4-02a3-4317-8f45-dfda2ade95a0"
/> | <img width="700" height="284" alt="image"
src="https://github.com/user-attachments/assets/cd5d50a3-3808-4630-80b2-c9e5237593e8"
/> |
…r removed (#38550)

<!-- 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!

### Issue Details
Removing a VisualState from VisualStateGroup.States does not properly
detach its triggers. If a trigger is subscribed to a long-lived event,
it can remain subscribed even after the state is removed. This can keep
the trigger and its referenced objects alive and cause objects to be
retained. The issue can occur with operations such as Clear(), Remove(),
RemoveAt(), and state replacement.

### Root Cause
VisualStateGroup.States previously used WatchAddList<VisualState>, which
did not provide callbacks for individual state removal. As a result,
removing a state did not detach its triggers or clear the state's
VisualStateGroup reference. This could leave trigger event subscriptions
active and prevent the trigger and its referenced objects from being
garbage-collected.

### Description of Change
Updated the VisualState collection handling to support individual state
addition and removal callbacks.

- Attach triggers when a VisualState is added to an existing
VisualStateGroup.
- Detach triggers when a VisualState is removed.
- Unapply the active state before removing it and clear CurrentState.
- Clear the removed state's VisualStateGroup reference.
- Attach triggers for existing states when a VisualStateGroup is added
to an attached element.
- Detach triggers and clear the group association when a
VisualStateGroup is removed.

This ensures that VisualState triggers are correctly attached and
detached throughout the state and group lifecycle and prevents trigger
event subscriptions from keeping removed states and referenced objects
alive.

### Issues Fixed
  
Fixes #38244

### Output

|Before|After|
|--|--|
| <img width="1200" height="400" alt="image"
src="https://github.com/user-attachments/assets/42f48169-1fc7-41e5-9f1e-bbc65551843c"
/> | <img width="700" height="210" alt="image"
src="https://github.com/user-attachments/assets/417f0517-3235-4a47-960e-cea352efa278"
/> |

---------

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
<!-- 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!

### Issue Details
When multiple PathFigure instances use the same PathSegmentCollection,
the CollectionChanged event subscription can keep the PathFigure
instances alive even after they are no longer referenced.
This can prevent the PathFigure objects from being garbage collected and
may result in increasing memory usage when this scenario occurs
repeatedly.

### Description of Change

<!-- Enter description of the fix in this section -->
* Added WeakNotifyCollectionChangedProxy to manage
PathSegmentCollection.CollectionChanged subscriptions using a weak
reference.
* Updated PathFigure finalization to unsubscribe the collection proxy
when the PathFigure is finalized.
* Updated the collection subscription and unsubscription logic to use
the proxy.

### Issues Fixed

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

Fixes #38718 

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

 **Tested the behavior in the following platforms.**
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac

| Before  | After  |
|---------|--------|
| **Android**<br> <video
src="https://github.com/user-attachments/assets/c3a742a8-a8c8-4cec-a5d4-b2340fbe179a"
width="300" height="600"> | **Android**<br> <video
src="https://github.com/user-attachments/assets/f00c73ee-25ae-42f6-a0ad-23a5efd407d3"
width="300" height="600"> |
<!-- Please keep the note below for people who 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 whether this change resolves your
issue. Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

This pull request updates the way
`ImageSourceToImageSourceServiceTypeMapping` manages its mapping between
`IImageSourceServiceCollection` instances and their corresponding
service type mappings, switching from a strong reference dictionary to a
weak reference table. This change is designed to allow for proper
garbage collection of service collections when they are no longer in
use, preventing memory leaks. A new unit test is also added to verify
that service collections can be collected by the garbage collector.

**Memory management improvements:**

* Replaced `ConcurrentDictionary` with `ConditionalWeakTable` in
`ImageSourceToImageSourceServiceTypeMapping` to ensure that
`IImageSourceServiceCollection` instances can be garbage collected when
no longer referenced, reducing the risk of memory leaks.

**Testing enhancements:**

* Added a unit test
`RegisteredImageSourceServiceCollectionCanBeCollected` to verify that
`IImageSourceServiceCollection` instances registered with the mapping
can be garbage collected, confirming the effectiveness of the weak
reference approach.
* Introduced helper classes (`TestImageSource`,
`TestImageSourceService`, `TestImageSourceServiceCollection`) in the
test file to support the new garbage collection test.

**Dependency updates:**

* Added `System.Runtime.CompilerServices` and
`Microsoft.Maui.Hosting.Internal` namespaces to the test file to support
the use of `ConditionalWeakTable` and internal hosting features.


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

### Issues Fixed

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

Fixes #38670 

### Tested the behavior in the following platforms

- [x] Windows
- [x] Android
- [x] iOS
- [x] Mac

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="735" height="391" alt="Screenshot 2026-09-21 at 18 49 36"
src="https://github.com/user-attachments/assets/f00346e4-69a7-4453-9952-5ef717586d74"
/> | <img width="746" height="366" alt="Screenshot 2026-09-21 at 18 50
02"
src="https://github.com/user-attachments/assets/42fd3a23-0e0a-4cbf-820a-5bf6abb43725"
/> |
<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
…r leaves views rooted (#38657)

<!-- Please keep the note below for people who 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 whether this change resolves your
issue. Thank you!

<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

This pull request introduces a new unit test to detect and prevent
memory leaks in the hot reload system, and it also updates the logic in
the `UnRegister` method to ensure proper cleanup of registered views,
even when hot reload is disabled. These changes help ensure that memory
is managed correctly during hot reload operations and that no
unnecessary references are retained.

### Description of Change

**Hot reload system behavior:**

* Updated the `UnRegister` method in `HotReloadHelper.cs` to always
remove the view from `currentViews`, regardless of whether hot reload is
enabled, preventing potential memory leaks when unregistering views
while hot reload is disabled.

**Testing and memory management improvements:**

* Added a new test `HotReloadLeakTest` in `HotReloadLeakTest.cs` to
verify that the hot reload system does not leak memory by retaining
references to payloads after views are unregistered, covering control,
leaky, and mitigation scenarios.


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

### Issues Fixed

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

Fixes #38351 

### Tested the behavior in the following platforms

- [x] Windows
- [x] Android
- [x] iOS
- [x] Mac

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="725" height="400" alt="Screenshot 2026-09-18 at 16 23 38"
src="https://github.com/user-attachments/assets/c3d87ded-eaf2-4f22-9e2a-cb4ca23e2c84"
/> | <img width="716" height="308" alt="Screenshot 2026-09-18 at 16 22
56"
src="https://github.com/user-attachments/assets/69c362a3-eeaa-433d-8319-6ead28502606"
/> |
<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
<!-- 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!

### Issue Details
- On Android with Material 3 enabled, the Shell TabBar and TabbedPage
selection colors do not update when the application theme changes.


### Root Cause
- On Android Material 3, TabbedPage's
BottomNavigationView.ItemActiveIndicatorColor was not updated when the
application theme changed, causing the tab selection indicator to retain
the previous theme's color.

### Description of Change
- Added UpdateActiveIndicatorColor to BottomNavigationViewUtils to
update BottomNavigationView.ItemActiveIndicatorColor based on the
current application theme, ensuring the TabBar selection indicator uses
the correct color after a theme change.
- Integrated UpdateActiveIndicatorColor into ShellItemRenderer and
TabbedPageManager so the TabBar selection indicator is refreshed when
the appearance changes.
- Subscribed and unsubscribed to
Application.Current.RequestedThemeChanged in TabbedPageManager to
refresh the TabbedPage selection indicator when the application theme
changes.

### Issues Fixed
Fixes #38234

### Validated the behaviour in the following platforms
- [ ] Windows
- [x] Android
- [ ] iOS
- [ ] Mac


### Output
| Before | After |
|----------|----------|
| <video
src="https://github.com/user-attachments/assets/297ade85-9f14-4e31-9fb6-bc59cc8bce6f">|
<video
src="https://github.com/user-attachments/assets/f0f82993-dc89-4dbd-bdc4-e0aeb89cd820">
|

---------

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ps (#38850)

### Description of Change

Two stale facts in the Helix section of `docs/DevelopmentTips.md`:

- It lists `eng/pipelines/common/stage-device-tests.yml` as the pipeline
template; that file doesn't exist. The template is
`eng/pipelines/arcade/stage-device-tests.yml` (used by
`eng/pipelines/device-tests.yml` and `ci-device-tests.yml`).
- It gives iOS and Mac Catalyst the queue `osx.15.arm64.Open`, but
`eng/helix_xharness.proj` sets
`osx.15.arm64.maui.open;osx.26.arm64.open` for both. Android already
matches.

Docs-only.

AI assistance: found and prepared with Claude Code; I checked both
against the files in `eng/` before opening.

### Issues Fixed

None, small docs fix.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Missy Messa <47990216+missymessa@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nstead of their measured width on Android, iOS, and macOS (#38271)

<!-- 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!
 
### Issue Details

The SwipeMenuItems were rendered to the full width of the SwipeView
instead of their measured width on Android, iOS, and macOS.

### Root Cause 

On both platforms, `GetSwipeItemSize` for `ISwipeItemMenuItem` in
`Execute` mode never measured the native menu control's rendered content
— Android and iOS divided `contentWidth` by `items.Count` (full content
width with a single item).

### Description of Change
 
Now the GetSwipeItemSize is measures the native button (`SizeThatFits`
on iOS, `MeasureSpec.AtMost` on Android), converts to DIP/points.
 
### Issues Fixed
 
Fixes #37839 
 
**Tested the behavior in the following platforms.**
- [x] Android
- [ ] Windows
- [x] iOS
- [x] Mac
 
| Before  | After  |
|---------|--------|
| <Video
src="https://github.com/user-attachments/assets/d1112adf-74a7-4f5d-9f43-12f22be0b11b"
Width="300" Height="600" /> | <Video
src="https://github.com/user-attachments/assets/9ee4bbb1-8b4a-4813-acd5-7d79d8fb2981"
Width="300" Height="600" /> |
<!-- 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!

### Issue Details
- PathFigureCollection keeps a strong reference to the discarded
PathGeometry through its CollectionChanged handler, preventing garbage
collection and resulting in a memory leak.

### Root Cause
- PathGeometry subscribed directly to
PathFigureCollection.CollectionChanged, allowing a shared collection to
strongly retain the geometry through its event delegate.

### Description of Change
- Replaced the strong collection event subscription with
WeakNotifyCollectionChangedProxy, retained deterministic unsubscription
when Figures changes, added finalizer cleanup, and added a regression
test verifying that a shared collection does not retain PathGeometry.

### Issues Fixed
Fixes #38686

### Validated the behaviour in the following platforms
- [x] Windows
- [x] Android
- [x] iOS
- [x] Mac

### Output
| Platform | Before | After |
|----------|----------|----------|
| iOS | <img
src="https://github.com/user-attachments/assets/fb3c32f9-6b9e-4ea0-a28c-4dead1946bbc">
| <img
src="https://github.com/user-attachments/assets/184f5f15-8780-4b82-a9af-da602f7812d5">
|
| Android | <img
src="https://github.com/user-attachments/assets/d207a69b-65aa-4fc7-8670-3b23a9fb951e">
| <img
src="https://github.com/user-attachments/assets/700261b7-51f1-427e-acdf-86fa23fd78a3">
|
| Mac | <img
src="https://github.com/user-attachments/assets/eadd0622-cb53-43ba-a3a5-760685d16b3e">
| <img
src="https://github.com/user-attachments/assets/7ea16dab-0f13-4fe1-ba70-0e80fcbd4dbb">
|
| Windows | <img
src="https://github.com/user-attachments/assets/fafec7fd-0036-4d21-9f64-85f614cf3e02">
| <img
src="https://github.com/user-attachments/assets/f55e9e6a-2807-4e9a-8076-6691b2ad07fc">
|
<!-- 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!

### Description of Change

Windows CollectionView applied the full requested spacing to both sides
of each item container. Adjacent margins/paddings add, so
`ItemSpacing="30"` produced a **60-DIP gap**, not 30.

Split the requested spacing evenly between the two contributing sides in
`StructuredItemsViewHandler.Windows.cs`:
- Vertical linear layouts: top/bottom margins.
- Horizontal linear layouts: left/right padding.
- Grid layouts: horizontal/vertical margins.

For any finite spacing `S`, the adjacent contributions become `S/2 + S/2
= S`. This is not a DPI correction: WinUI handles scaling of these
logical units. Default zero spacing, the existing symmetric edge-spacing
approach, and native style inheritance are retained. Applications
compensating for the doubled spacing will need to remove that
workaround. This changes the default Windows CollectionView handler, not
the opt-in obsolete compatibility renderer.

### Empirical before/after evidence

The issue's XAML scenario was reproduced in the Sandbox against
repository sources on Windows ARM64. These are actual WinUI-rendered
page captures, not mockups. Native item bounds were measured after
layout.

| Before: requested 30, measured 60 DIPs | After: requested 30, measured
30 DIPs |
|---|---|
| ![Before: CollectionView spacing is
doubled](https://github.com/user-attachments/assets/0c8392d5-a3cf-45f2-a995-eec999981cbf)
| ![After: CollectionView spacing matches the requested
value](https://github.com/user-attachments/assets/393b3caa-bfee-4386-aca9-9a7b9ef27064)
|

Item dimensions stayed **300 × 40 DIPs**. Before, item Y positions were
`30, 130, 230, 330, 430, 530, 630`; after, `15, 85, 155, 225, 295, 365,
435`. All six adjacent gaps changed from 60 to 30 DIPs.

Additional runtime sampling completed **20 captures with zero
geometry-check failures**, including both linear orientations, both grid
orientations, and changing spacing back to zero:

| Requested linear spacing | Measured vertical gap | Measured horizontal
gap |
|---:|---:|---:|
| 0 | 0 | 0 |
| 10 | 10 | 10 |
| 30 | 30 | 30 |
| 7.5 | 8 | 8 |
| 0 after updates | 0 | 0 |

All captures recorded `XamlRoot.RasterizationScale = 1.0` and layout
rounding enabled. The fractional result is **8**, not exactly 7.5, due
to pixel snapping. No other display scale was empirically tested, and no
OS scaling settings were changed.

Grid native-container gaps measured `30/10` for requested
horizontal/vertical spacing `30/10`, in both orientations. Fixed-size
content centered inside a larger grid cell can have additional
whitespace; that is distinct from inter-container spacing.

### Regression coverage and verification

Windows device tests cover rendered linear gaps at zero, fractional, and
nonzero spacing; both grid axes/orientations; live spacing changes; and
untemplated style mapping. The tests measure the current realized native
view wrappers, reacquiring them when a style update replaces item
templates.

The repository's full A/B verification runner completed with
**`VERIFICATION PASSED`**:
- Original framework code: **10 failed, 0 passed** targeted cases.
- Fixed framework code: **10 passed, 0 failed** targeted cases.

The fix and tests were reviewed independently with GPT-5.3-Codex and
GPT-5.6 Sol. Feedback was addressed, and final reviews reported no
remaining actionable findings. The subsequent [independent Windows
review](#38960 (review))
on head `2e987fc48c` also reproduced **10 failures without the fix and
10 passes with it**, with no actionable code-review findings. That
review's own UI stage produced no results; screenshot verification below
comes from the separate public UI pipeline.

### Windows UI baseline updates

The initial [UI build
1614797](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1614797)
exposed eight snapshots that encoded the old doubled spacing. Only those
eight Windows baselines were updated from inspected CI captures. Item
sizes, selection indicators, and closed swipe states are preserved; the
changed gutters and resulting content positions reflect the corrected
spacing. For example, `CVHorizontalLinearItemsLayoutItemSpacing` retains
identical item widths while all five measured gaps change from 20 to the
requested 10 pixels.

[Device build
1614798](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1614798),
on the preceding code-identical head `5ee75080b0`, passed all ten new
Windows regression cases. Its packaged and unpackaged Windows
CollectionView result files each report **50 passed, 0 failed, 1 known
skip**. After the snapshot updates, a fresh local device run also passed
all ten targeted cases (full CollectionView results: 50 passed, 0
failed, 1 skipped). The current-head [device build
1614911](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1614911)
confirmed those same packaged and unpackaged Windows results, including
all ten new regression cases.

Local Appium screenshot verification was blocked by WinAppDriver's
`/status` returning HTTP 500, so none of the eight UI methods ran
locally. **All eight updated screenshot tests passed in [UI build
1614910](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1614910)**,
verified from their actual per-test results:
`CVHorizontalLinearItemsLayoutItemSpacing`,
`CollectionViewHeightIsCorrectAfterDelayedLoad`,
`CollectionViewPreSelectionShouldUpdate`,
`CollectionViewSelectionModeOnLightTheme`, `Issue23377ItemSpacing`,
`OnlyManuallySwipedItemShouldBeOpened`,
`VerifyCVBackgroundAndBackgroundColorWithVSM`, and
`VerticalItemsRemainFullyVisibleAfterChangingSpacing`. These are CI
screenshot passes, not an inference from the device tests.

### Build artifacts and CI scope

[Main build
1614908](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1614908)
completed successfully. Its **PackageArtifacts** archive contains
`Microsoft.Maui.Controls` and `Microsoft.Maui.Controls.Core` version
**`10.0.120-ci.pr38960.26478.60`**, including the Windows framework
assemblies. Follow [Testing PR
Builds](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) to try
these packages.

The broader device and UI pipelines are **not all green**. Their
non-Windows failures and timed-out retries are tracked separately from
the verified Windows spacing results; the targeted passes above do not
imply whole-suite success.

### Related work

After developing this fix independently, I checked for existing fixes.
#38367 addresses a different untemplated-grid stretching issue in the
.NET 11 handler; it does not correct these additive margins/paddings in
the current Windows handler.

### Issues Fixed

Fixes #38959

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…acingItemDecoration + ObservableGroupedSource) (#38969)

> [!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!

On Android, a `CollectionView` with `GridItemsLayout` blocks the UI
thread for tens of seconds (and ANRs on fling) once the item count
reaches a few thousand. Assigning 10 000 grouped items: 94 ms on 10.0.90
→ ~40 s on 10.0.100+. Ungrouped grids regressed ~12× and stutter on
fling. Independently, `ScrollTo` a far group in a grouped grid took ~38
s for 10 000 items on every version.

1. #35782 changed `SpacingItemDecoration.GetItemOffsets` to call
`SpanSizeLookup.GetSpanGroupIndex(itemCount - 1)` for **every cell on
every layout pass**. That is the uncached AndroidX API: it iterates
`getSpanSize()` (a JNI round-trip into `GridLayoutSpanSizeLookup`) over
every position between the nearest cached key and the target — O(n) per
cell. #38341 later fixed a crash on this path but not the cost.
2. `ObservableGroupedSource.GetGroupAndIndex` stepped one position at a
time (O(position)). It is reached from `GetItemViewType` for every
span-size query, so grouped grids paid O(n²) and any `ScrollTo` to an
uncached region was quadratic.

- `SpacingItemDecoration`: return early when both offsets are 0; decide
first/last row by inspecting only the ≤ spanCount items that can share
the row, starting from the span index `GridLayoutManager` already
assigned to the child (`LayoutParams.SpanIndex`, falling back to
`GetSpanIndex`). Output is unchanged.
- `ObservableGroupedSource.GetGroupAndIndex`: walk groups with live
counts (O(groups)). Live counts are required because
`ReorderableItemsViewAdapter.OnItemMove` mutates groups with
`ObserveChanges` disabled. Empty groups without a header are now
resolved correctly (the old loop returned the empty group's index for
the next group's first item) and out-of-range positions no longer index
past `_groups`.

Not in this PR (follow-up candidate for #38926): overriding
`GetSpanIndex`/`GetSpanGroupIndex` in `GridLayoutSpanSizeLookup` so that
`GridLayoutManager` itself never walks `getSpanSize` across JNI for
uncached positions (ungrouped up-scroll after a jump still shows this).

HostApp `Issue38925` page (50 groups × 200 items, `Span=4`, spacing 4),
Release, HONOR PGT-N19 / Android 16. "UI thread blocked" measured from
the action until a `Dispatcher.Dispatch` callback runs.

| Step | `main` before | `main` with this PR |
|---|---|---|
| Set `ItemsSource` | 59 683 ms | **110 ms** |
| `ScrollTo` last group | 131 839 ms | **678 ms** |
| `ScrollTo` first group | 57 693 ms | **105 ms** |

| Before (4× speed) | After |
|---|---|
| <video
src="https://github.com/user-attachments/assets/dcb43c20-c088-4784-ad63-e921fa4d0ecb"
width="300"> | <video
src="https://github.com/user-attachments/assets/46baf477-5262-4c4e-9fcd-85976022dd65"
width="300"> |

Rendering verified unchanged: pixel-identical screen-recordings of the
grid region before/after on the same device; `Issue35700`'s existing
snapshot test covers grouped-grid spacing in CI.

- `TestCases.HostApp/Issues/Issue38925.cs` +
`TestCases.Shared.Tests/Tests/Issues/Issue38925.cs` (Android): load 10
000 grouped items, `ScrollTo` end and start; each must complete within
the default wait. Fails before the fix (every step > 15 s), passes
after.
- `DeviceTests/.../CollectionViewTests.Android.cs`:
`GroupedSourceGetGroupAndIndexMatchesGroupContents` — 16
header/footer/group-header/group-footer combinations, including an empty
group, checked against a brute-force reference.

Fixes #38925
Fixes #38926

- [x] Android
- [ ] iOS (not applicable — Android handler only)
- [ ] Mac (not applicable)
- [ ] Windows (not applicable)
… fix a crash in -[UIView dealloc] on iOS 17 (#38662)

**TL;DR** — On iOS 17 and older, a managed KVO observer
(`NSObject.AddObserver(key, options, Action)`) that is garbage-collected
while still registered leaves a dangling pointer in the observed
object's KVO registry, and the next notification crashes the app —
typically `-[UIView dealloc]` under the `NSObject_Disposer` drain.
`ViewExtensions.OnLoaded` registered such observers on the layer of
every platform view without `IUIViewLifeCycleEvents` and kept them until
the view loaded, so views that never reach a window crashed later. This
PR replaces every managed KVO registration in MAUI with a Swift-owned
observation (`MauiKeyValueObserver` in the AppleNative interop, wrapped
by an internal `KeyValueObservation` facade) whose registration cannot
outlive its observer, makes `PlatformTouchGraphicsView` raise
`MovedToWindow` itself so `GraphicsView` never takes the fallback, and
fixes the device-test collection helper so the `Memory` suite is green
on iOS 17.5 too. No public API change except the `MovedToWindow`
override.

### Description of Change

#### The crash

Reported from a production app on iPhone 15 / iOS 17.5 (arm64), and
reproduced byte-for-byte on an iOS 17.5 simulator by the new device test
on the unmodified code:

```
EXC_BAD_ACCESS KERN_INVALID_ADDRESS
  libobjc.A.dylib      class_getMethodImplementation
  Foundation           _NSKVONotifyingOriginalClassForIsa
  Foundation           _NSKeyValueObservationInfoGetObservances
  Foundation           NSKeyValueWillChangeWithPerThreadPendingNotifications
  QuartzCore           CA::Layer::begin_change
  QuartzCore           CA::Layer::set_delegate
  UIKitCore            -[UIView dealloc]
  libxamarin-dotnet    xamarin_release_managed_ref
  <app>                +[__NSObject_Disposer drain:]
  Foundation           __NSThreadPerformPerform
  CoreFoundation       __CFRunLoopDoSource0 ...
```

The original report named `-[PlatformGraphicsView release]`, i.e. a
`GraphicsView` being released by the garbage collector's disposer.

#### Root cause

The .NET iOS block-based observer (`NSObject.Observer`, private)
unregisters itself only in `Dispose(true)`. Its finalizer just logs
`Warning: observer object was not disposed manually with Dispose()` and
releases the native object. KVO does not retain observers, so an
observer that is collected instead of disposed is freed while still
registered.

What happens next depends on the OS — measured with a probe that tracked
the native observer through a zeroing weak reference and dumped the
observed layer's `observationInfo`:

| OS | State of the registration after the observer is freed | Next KVO
notification on the object |
|---|---|---|
| iOS 17.5 | `NSKeyValueObservance` keeps an **unretained** pointer to
the freed observer | Crash in `_NSKeyValueObservationInfoGetObservances`
(even `-[NSKeyValueObservationInfo description]` crashes) |
| iOS 18.6, 26.x | `NSKeyValueObservance` reads `Observer: 0x0` — a
**zeroing weak** reference | Dead observer is skipped; the stale
registration lingers |

This is why the crash reproduces only on iOS 17-class devices and why
nothing shows on current simulators. `-[UIView dealloc]` is where it
usually surfaces because UIKit clears the layer's delegate there, and a
CALayer raises KVO for `delegate` from `CA::Layer::set_delegate`.

#### How MAUI reached it

`ViewExtensions.OnLoaded` (iOS) has two paths. Platform views
implementing `IUIViewLifeCycleEvents` raise `MovedToWindow`. Every other
platform view — `PlatformGraphicsView`, `UIButton` (Button,
ImageButton), `UISlider`, `UISwitch`, `UIStepper`, `UIProgressView`, the
raw `UIImageView`/`UIScrollView` handlers and the web views — fell back
to two managed KVO observers on the view's layer (`bounds` and `frame`),
removed only once the view was loaded or the token disposed. A view that
never reaches a window (a measured-but-never-shown template, a page
discarded before it appears) keeps them until collection, and the
collector frees the view and its observers in no particular order.
Whenever an observer went first, the view's own `dealloc` hit the
dangling pointer.

Four more sites used the same overload: `MauiCollectionView`
(`contentOffset`), `WindowHandler` (window `frame` and scene
`effectiveGeometry`), `WindowOverlay` (window `frame`) and
`VisualDiagnosticsOverlay` (`contentOffset`). The legacy compatibility
`SetBinding` observer (`NativeViewPropertyListener`) is a different
mechanism and is left alone.

#### The fix

**`MauiKeyValueObserver` (Swift, `src/Core/AppleNative`).** Typed
`observe(\.keyPath)` for a closed set of keys — layer `bounds`, view
`frame`, scroll view `contentOffset`, window scene `effectiveGeometry`
(`@available` 16) — each owned by an `NSKeyValueObservation` token that
unregisters on `invalidate()` and on `deinit`. A registration therefore
cannot outlive its observer, whatever order the collector frees things
in; the native release runs on the main thread through the same disposer
drain visible in the crash. Same pattern as the existing
`MauiCALayerAutosizeToSuperLayerBehavior`. The closed set is deliberate:
a new observed key needs a native change, which keeps KVO from spreading
casually. The UIKit methods are `@MainActor` because Swift 6 only lets
those key paths be formed on the main actor; the compiled framework
imports no runtime isolation-check function, so this is a compile-time
constraint only.

**`KeyValueObservation` (C#, internal).** Static factories per key
(`ObserveBounds(CALayer, Action)`, `ObserveFrame(UIView, Action)`,
`ObserveContentOffset(UIScrollView, Action)`,
`ObserveEffectiveGeometry(UIWindowScene, Action)`) returning an
`IDisposable`. The native side retains the block it is given, and a
block pins its managed delegate: handing Swift the caller's handler
directly would let the handler reach the observation (in `OnLoaded` it
does, through the closure) and root the whole graph forever — the crash
would become a leak. The facade therefore hands Swift a callback that
holds only a `WeakReference` to itself; the real handler lives in a
managed field and may capture anything. Two device tests fail without
this trampoline.

**Call sites.** `OnLoaded` observes only the layer's `bounds` through
the facade; `MauiCollectionView`, both `WindowHandler` proxies,
`WindowOverlay` and `VisualDiagnosticsOverlay` use the matching factory.
Handlers no longer take an `NSObservedChange`; the effective-geometry
handler reads `scene.EffectiveGeometry` directly, the same value the
change payload carried.

**Layer `frame` is not observable.** A probe observing `frame` and
`bounds` separately on a layer showed zero `frame` notifications for
`layer.Frame =`, `view.Frame =`, `view.Bounds =` and an autoresize
layout pass, while `bounds` fired for each: `CALayer` raises KVO from
its stored attributes only and `frame` is derived. The old `OnLoaded`
frame observer was a no-op, so it is simply dropped. (`UIView.frame`
does notify on `setFrame:` and on layout-driven resizes, which is what
the window observers rely on.)

**`PlatformTouchGraphicsView` implements `IUIViewLifeCycleEvents`**
exactly like `MauiLabel` and the other MAUI views, so `GraphicsView` —
the view in the report — takes the `MovedToWindow` path and registers no
observation at all. This also makes `Unloaded` fire properly for it. It
requires a public `MovedToWindow` override: one line in each Apple
`PublicAPI.Unshipped.txt`, the only public API change in the PR.

**TestUtils `AssertionExtensions.Collect()`.** While verifying on iOS
17.5, the four existing
`MauiCALayerAutosizeToSuperLayerBehavior_DoesNotLeak` cases failed there
on pristine `main` too. They were not leaking: `Collect()` only ever
yielded to the thread pool, but a finalized wrapper releases its native
peer on the main thread (disposer drain), and a released `UIView` hands
its layer to the pending Core Animation transaction, which frees it only
on commit. Each link of that chain (view → layer → toggle-ref'd
sublayer) needs a main-thread turn, and the 40-iteration loop outran it
on 17.5. `Collect()` now hops to the main thread through the same queue
the disposer uses (so it lands after the drain) and calls
`CATransaction.Flush()` there. A hop alone was not enough; the flush is
the decisive part. Apple platforms only, `#if IOS || MACCATALYST`.

#### Not changed, on purpose (follow-ups)

- The stock UIKit-backed handlers (Button, ImageButton, Slider, Switch,
Stepper, ProgressBar, raw image/scroll/web views) still infer `Loaded`
from a layer `bounds` change. It is now safe, but small subclasses
raising `MovedToWindow` (created in each handler's `CreatePlatformView`,
without changing the generic platform-view type) would remove the
heuristic altogether.
- `VisualDiagnosticsOverlay.AddScrollableElementHandler` resolves the
target with `ToPlatform()`, which returns the container view for a
wrapped ScrollView (Shadow, Clip); such ScrollViews get no observation,
as before. The right target is `Handler.PlatformView`.
- `VisualDiagnosticsOverlay` throws on a duplicate `IScrollView`
registration (pre-existing).

### Issues Fixed

No issue was filed; this comes from a production crash report (iPhone
15, iOS 17.5, arm64) with the stack above, hitting
`PlatformGraphicsView` release. Happy to open one if a tracking issue is
preferred.

### Tests

**`Core.DeviceTests` → `Memory/KeyValueObservationTests`** (iOS + Mac
Catalyst):

- `ObservesUntilDisposed` — layer bounds, view frame and scroll content
offset all notify; nothing notifies after `Dispose`.
- `CanBeDisposedFromItsOwnHandler` — disposing from inside the callback
(what `OnLoaded` does when the view turns out to be loaded) is safe.
- `HandlerReferencingItsObservationDoesNotLeak` — a handler that reaches
its own observation is still collectable (the weak trampoline).
- `OnLoadedOnViewsThatNeverLoadSurvivesCollection` — 200 never-loaded
views with `OnLoaded` tokens, collected together. **Crashes the original
code on iOS 17.5** with the stack above.
- `OnLoadedTokenCollectedBeforeItsViewLeavesTheViewUsable` — the harmful
order: tokens collected while the views live on, then the views change
frame.
- `OnLoadedFiresThroughTheObservation` — a plain `UIView` (no lifecycle
events) still gets `Loaded` through the new path.
- `GraphicsViewLoadsThroughLifecycleEventsNotKvo` —
`PlatformTouchGraphicsView` exposes `IUIViewLifeCycleEvents` and gets
`Loaded` on attach.

Results (`Category=Memory`, xharness, simulators):

| Build | iPhone 15 / iOS 17.5 | iPhone 11 Pro / iOS 26 |
|---|---|---|
| Original `OnLoaded` + new fixture | **app crash**, `EXC_BAD_ACCESS` in
`-[UIView dealloc]` (stack above) | 11/11 pass (no crash — iOS 18+ skips
dead observers) |
| Fix with the handler passed to Swift **directly** (no weak trampoline)
| — | `HandlerReferencingItsObservationDoesNotLeak` and
`OnLoadedOnViewsThatNeverLoadSurvivesCollection` **fail** (leak) |
| This PR | **13/13** (incl. the 4 autosize leak tests, which fail on
pristine `main` there) | **13/13** |

Also verified: `Controls.Core` builds clean for `net10.0-ios` and
`net10.0-maccatalyst` with the PublicAPI analyzer; the probe results
above (observance state per OS, layer `frame` never notifying, the
autosize "leak" resolving by itself after one more second) are from
throwaway tests that are not part of the change.

**A note on CI coverage.** The two crash-reproducing tests only
discriminate on iOS 17 and older: on iOS 18+ Foundation skips a dead
observer, so they pass with the original code too (the two leak tests
discriminate everywhere). If CI runs device tests on current simulators
only, this class of bug — a use-after-free that newer Foundation happens
to tolerate — stays invisible until it ships to older devices. It would
be worth running the device-test suites (at least `Memory`) on an iOS
17.x simulator on some cadence, e.g. a scheduled weekly job or a runtime
matrix entry for the Apple lanes, since iOS 17 devices are still very
much in the field. The `Collect()` fix in this PR makes the `Memory`
category green on 17.5 so such a lane would start clean.
### Description of Change

Sort generated global XML namespace definitions by XML namespace, target
CLR namespace, and assembly name before emitting `Global.Xmlns.cs`.

Previously, equivalent compilations with the same metadata references in
a different order produced different generated source. The attribute set
was identical, but its order followed metadata reference enumeration
order. This made the generator output non-deterministic and could
surface as unnecessary generated-code changes during Edit and Continue /
Hot Reload.

Adds a regression test that:

- creates two equivalent compilations with reversed metadata reference
order;
- runs the XAML generator for both;
- verifies that all generated hint names and contents are identical.

Validation:

- `SourceGen.UnitTests`: 208/208 passed

### Issues Fixed

Fixes #38841
<!-- 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!
### Issue Details
MenuItem is implicitly wrapped in an internal MenuShellItem when added
to Shell. The wrapper assigns itself as the MenuItem.Parent and
subscribes to MenuItem.PropertyChanged.
 
When the wrapper is removed from Shell, these references were not
released. A long-lived MenuItem could therefore retain the wrapper, its
BindingContext, and the associated object graph, causing a managed
memory leak on all platforms.

### Description of Change

<!-- Enter description of the fix in this section -->
Added connection lifecycle management to MenuShellItem:
* Connects when the wrapper receives a parent.
* Subscribes to MenuItem.PropertyChanged.
* Assigns the wrapper as the MenuItem.Parent.
* Disconnects when the wrapper is removed from its parent.
* Unsubscribes from PropertyChanged.
* Clears MenuItem.Parent when it still references the wrapper.
* Uses _isConnected to prevent duplicate subscriptions and cleanup.

### Issues Fixed

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

Fixes #38579 

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

 **Tested the behavior in the following platforms.**
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac


| Before  | After  |
|---------|--------|
| **Android**<br> <img
src="https://github.com/user-attachments/assets/6694ded9-fab6-4b95-a7ee-8b89fed9a048"
width="300" height="600"> | **Android**<br> <img
src="https://github.com/user-attachments/assets/9081afe5-7c29-4b9a-9a9c-ad44086cac2b"
width="300" height="600"> |
…llectionView items (#39012)

<!-- 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!

### Description of Change

Recreates #37674 for `inflight/current`, porting the merged commit
904c032 without unrelated `main`
changes. The implementation and four device regression tests are
preserved; the accessibility extension's whitespace is normalized to
repository formatting.

Selectable CollectionView items on iOS/Mac Catalyst apply the Button
accessibility trait to the first exposed accessibility element within
the item template instead of an inaccessible container. Native UIControl
subtrees keep their existing roles. Per-cell state tracks traits added
by CollectionView so disabling selection clears only framework-added
traits, preserving developer-assigned Button traits.

Includes the original semantic-property mapper hook and device tests for
nested accessibility elements, native-control roles, disabling
selection, and changing accessibility targets.

### Issues Fixed

Fixes #37140.

Original PR: #37674 by @Dhivya-SF4094.

### Validation

- Original patch applied cleanly to `inflight/current` and matched the
source commit's stable patch ID before whitespace formatting.
- Formatting verification and `git diff --check` passed.
- MAUI build tasks and the Mac Catalyst Controls device-test app built
successfully.
- Local execution of the four original regression tests was attempted
but blocked: the pinned XHarness tool requires `Microsoft.NETCore.App
11.0.0-rc.1.26420.103`, which is not installed. No passing device-test
result is claimed; CI validation is pending.

Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…from the items source instead of walking every position (#39063)

> [!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!

### Issue Details
After #38969, `GridLayoutManager` still resolves the span index / row of
a position it has not cached yet by calling `getSpanSize()` for every
position from the nearest cached key to the target — a JNI round-trip
each. `ScrollTo` into a cold region of a large grid, or laying out rows
while scrolling back up past the cached keys, is O(n) per lookup: 200
000 grouped items, `ScrollTo` last group blocks the UI thread for 12.8 s
(6.9 s flat).

### Root Cause
`GridLayoutSpanSizeLookup` only overrides `GetSpanSize`;
`GetSpanIndex`/`GetSpanGroupIndex` fall back to AndroidX's walk.

### Description of Change
Override `GetSpanIndex`/`GetSpanGroupIndex`. The items source already
knows where full-span items sit, so the layout is a short list of blocks
(a full-span item, or a run of regular items that starts on a fresh row)
and the answer is arithmetic plus a binary search. The table is rebuilt
lazily after `AdapterDataObserver` notifications (the same ones
`GridLayoutManager` uses to drop its own span caches) or a span-count
change; adjacent groups without a separating header/footer are merged
into one run because they share rows. Unknown adapters fall back to the
base implementation. `ItemsViewAdapter` gains an internal
`IItemsViewAdapter` view of its source; no public API change.

⚠️ Since this is a follow-up PR of #38969, which is only merged to
inflight/current, the source branch of this PR is based on
inflight/current also. Tests and measurements for baseline are based on
inflight/current with the first PR in place to demonstrate the diff on
top of that improvement. If needed I can rebase onto main.

### Measurements (HONOR PGT‑N19, Release, 200 000 items, Span=4, UI
thread blocked)
Step | Grouped before | Grouped after | Flat before | Flat after
-- | -- | -- | -- | --
Load | 127 ms | 110 ms | 83 ms | 110 ms
ScrollTo end | 13 412 ms | 92 ms | 7 081 ms | 146 ms
ScrollTo middle | 2 523 ms | 123 ms | 1 787 ms | 120 ms
ScrollTo start | 112 ms | 127 ms | 203 ms | 141 ms

| Before | After |
|---|---|
| <video
src="https://github.com/user-attachments/assets/d8206648-bf64-4207-8b4e-dd195d217f8a"
width="300"> | <video
src="https://github.com/user-attachments/assets/ed798125-b2cc-4092-b1d2-6ad17c86d25b"
width="300"> |

### Tests
- Device: `GridSpanLookupMatchesGreedySpanAssignment` — 128 combinations
checked position-by-position against the greedy assignment
`GridLayoutManager` derives from `GetSpanSize`;
`GridSpanLookupTracksGroupedSourceChanges` — item and group insertions.
- UI: `Issue38926` — 200 000 items grouped and flat; `ScrollTo` end /
middle / start must each finish within 5 s (before: 1.8–12.8 s; after:
~100 ms).

### Issues Fixed
Fixes #38926
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

Fixes the ARGB value for MediumPurple color

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

Fixes #39076

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- 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. !!!!!!!
-->

### Description of Change

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

Wait for the swipe command's result text before asserting its exact
value in `Issue36154SwipeViewShouldRevealItems`. `ResultLabel` already
exists before the drag, so `WaitForElement` alone does not wait for
command execution.

The Windows leg of [inflight/current UI build
1621019](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1621019)
contains both a pass and a failure on the same SHA. Run `44910192`,
result `100088`, fails with the initial text `Swipe result will appear
here` rather than `RIGHT invoked!`. Its [failure
screenshot](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/44910192/Results/100088/Attachments/9)
still shows the initial text, while the subsequently captured [native
page
source](https://dev.azure.com/dnceng-public/public/_apis/test/Runs/44910192/Results/100088/Attachments/7)
has `ResultLabel` with `Name="RIGHT invoked!"`. [The diagnostic capture
code](https://github.com/dotnet/maui/blob/9e1139831877611d5ef9e20bfd8705b94a89a877/src/TestUtils/src/UITest.NUnit/UITestBase.cs#L288-L323)
takes the screenshot before retrieving the element tree. This identifies
a premature assertion, not just intermittent outcomes. The preceding
[build
1617939](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1617939)
also contains both outcomes for this exact Windows test; all five
sampled preceding builds contain a pass, with unchanged test and host
source.

This one-line change asserts success from the existing bounded
`WaitForTextToBePresentInElement` helper, then retains the original
exact equality. The gesture, platform coverage, product implementation
and visual baselines are unchanged. No whole-test retries, sleeps or
timeout overrides are added.

**Validation**

- `dotnet build Microsoft.Maui.BuildTasks.slnf --nologo --verbosity
quiet` — passed.
- `dotnet build
src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj
--no-restore --nologo --verbosity quiet -m:2 -nr:false` — passed, zero
warnings/errors; compilation only, no UI execution.
- `dotnet format whitespace --folder --include
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36154.cs
--verbosity quiet` — passed.
- `git diff --check` — passed.
- `pwsh -NoProfile .github/scripts/BuildAndRunHostApp.ps1 -Platform
catalyst -TestFilter
'FullyQualifiedName~Issue36154SwipeViewShouldRevealItems'` — initial
attempt required rebuilding MSBuild tasks; subsequent attempt stopped
during test-project compilation at the user's request, before
UI/Appium/XCTest execution. No local runtime result is claimed.

After-fix Windows runtime validation is pending CI. The PR will be
watched for actual test results and earlier runner attempts rather than
treating a retried green job as proof that the flake is eliminated.

### Issues Fixed

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

Fixes the timing-sensitive assertion in the SwipeView regression test
for #36154.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------
… fails (#39149)

### Description of Change

On iOS, a `ListView` with `HasUnevenRows="True"` whose cells contain URI
images logs:

```
Microsoft.Maui.Handlers.IImageHandler: Error: Unexpected exception in MapSource.
System.InvalidOperationException: PlatformView cannot be null here
   at Microsoft.Maui.Handlers.ImageHandler.ImageImageSourcePartSetter.SetImageSource(UIImage platformImage)
   at Microsoft.Maui.Platform.ImageSourcePartExtensions.UpdateSourceAsync(...)
```

**Root cause**

1. `ListViewRenderer.CalculateHeightForCell` measures a cell and then
disconnects its handlers. `ImageHandler.DisconnectHandler` calls
`SourceLoader.Reset()`, which cancels the pending load.
2. `UriImageSource.DownloadStreamAsync` catches the
`TaskCanceledException` and returns a `null` stream, so
`UriImageSourceService` throws `InvalidOperationException("Unable to
load image stream from URI ...")` instead of an
`OperationCanceledException`.
3. In `ImageSourcePartExtensions.UpdateSourceAsync` (iOS), that
exception goes to the generic `catch`, which calls `setImage(null)`. The
success path already skips `setImage` when the token is cancelled; the
error path doesn't.
4. `SetImageSource` reads `Handler.PlatformView` on the disconnected
handler, and the typed getter throws. The exception escapes the `catch`
block, so `LoadingFailed` isn't raised either, and `MapSource` logs it.

**Fix**

In `UpdateSourceAsync`, an exception thrown after the token was
cancelled is handled like an `OperationCanceledException`: no
`setImage(null)`, and `LoadingCompleted(false)` instead of
`LoadingFailed`. This matches the
`!cancellationToken.IsCancellationRequested` check on the success path.
Failures of loads that weren't cancelled are handled as before.

The change is limited to
`src/Core/src/Platform/iOS/ImageSourcePartExtensions.cs` (iOS and Mac
Catalyst). Android has a similar `catch`, but it loads into the
`ImageView` through Glide and the issue isn't reported there, so I left
it unchanged.

**Tests**

- New device test
`CancelledLoadThatFailsDoesNotUpdateDisconnectedHandler` (iOS/Mac
Catalyst). It starts a load with `CountedImageSourceServiceStub`,
disconnects the handler while the load is pending, and lets the service
throw a non-cancellation exception, as `UriImageSourceService` does. It
then expects `UpdateImageSourceAsync` to complete and only
`LoadingCompleted(False)` to be raised.
- To support this, `CountedImageSourceStub` has a new
`FailWhenCancelled` option, which the iOS stub service honors.

Verified locally on Mac Catalyst (Release):

| | Without fix | With fix |
|---|---|---|
| New test | Fails with `InvalidOperationException: PlatformView cannot
be null here` (same stack as the issue) | Passes |
| `Category=Image` | 91 passed, 1 failed, 8 skipped | 92 passed, 8
skipped |

With the fix, I also ran `Image` on the iOS simulator, plus the
categories that cover the other `ImageSourcePartLoader` users on iOS
(`ImageButton`, `Button`, and `SwipeView` for `SwipeItemMenuItem`) and
`ImageSource`:

| Platform | Category | Result |
|---|---|---|
| iOS 26.5 simulator | `Image` | 97 passed, 3 skipped |
| Mac Catalyst | `ImageButton` | 149 passed, 14 skipped (includes the
new test via `ImageButtonImageHandlerTests`) |
| Mac Catalyst | `ImageSource` | 66 passed, 2 skipped |
| Mac Catalyst | `Button` | 107 passed, 6 skipped |
| Mac Catalyst | `SwipeView` | 64 passed, 6 skipped |

A local run of the whole Core device test suite on Mac Catalyst timed
out without producing results, so I ran these categories one at a time
instead and relied on CI for the full suite.

### Issues Fixed

Fixes #38845

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…emsSource (#39151)

### Description of Change

On Android, a `CarouselView` whose `ItemsSource` creates new items each
time it is enumerated ends up with `Position == -1` after the handler is
created. The reporter's repro uses a lazy LINQ projection:

```csharp
mainObject.Items = source.Select(x => new CarouselModel { ... }); // no ToList()
```

**Root cause**

During handler creation, `MapItemsSource` and then `MapItemTemplate`
both call `MauiCarouselRecyclerView.UpdateAdapter()`, and each creates a
new adapter that enumerates the `ItemsSource` again:

1. The first `UpdateInitialPosition()` has no `CurrentItem` yet, so it
uses `Position` and calls `SetCurrentItem`. `CurrentItem` becomes an
item from that first enumeration.
2. The second `UpdateInitialPosition()` enumerates the `ItemsSource`
again and gets new instances, so `items.IndexOf(Carousel.CurrentItem)`
returns -1. It then sets `Carousel.Position = -1`.

Before #31722 (10.0.50), `MapPosition` passed that -1 to
`UpdateFromPosition`, which threw the reported
`IndexOutOfRangeException: Can't set CarouselView to position -1`.
#31722 made `MapPosition` ignore negative positions, so it no longer
throws. But `Position` is still left at -1 (raising `PositionChanged`
with -1 and pushing -1 to TwoWay bindings), and `CurrentItem` still
points to an item that isn't in the `ItemsSource`. The reporter's
workaround of resetting `Position` from `PositionChanged` is for this.

**Fix**

If `CurrentItem` isn't found and the current `Position` is a valid
index, keep `Position` instead of replacing it with -1. `SetCurrentItem`
then updates `CurrentItem` to the item at that position in the new
adapter. iOS already does this in `UpdateInitialPosition`
(`CarouselViewController` and `CarouselViewController2`: "Sometimes the
item could be just being removed..."). If `Position` is out of range,
the behavior is unchanged, so this doesn't add any new `GetItem` call
with an invalid index.

**Tests**

New Android device test
`PositionInitializesCorrectlyWhenItemsSourceCreatesNewItems` in
`CarouselViewTests.Android.cs`. It is modeled on
`PositionInitializesCorrectly` and runs for positions 0, 1 and 2 with
`Loop` true and false. It asserts `Position`, the `CurrentItem` and the
platform scroll position.

Android 37 emulator, Release, `Category=CarouselView`:

| | Without fix | With fix |
|---|---|---|
| New test (6 cases) | 6 fail: `Expected: <position>, Actual: -1` | 6
pass |
| `Category=CarouselView` | 10 passed, 6 failed | 16 passed |

I didn't run the Appium UI tests locally.

### Issues Fixed

Fixes #32037

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…er is disposed (#39152)

### Description of Change

The report (10.0.40) is a crash with no repro:

```
System.ObjectDisposedException: ... MobileClient.CustomSectionRenderer
   at UIKit.UINavigationController.get_NavigationBar()
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.<SendPop>b__28_0()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_0(Object state)
   at Foundation.NSAsyncSynchronizationContextDispatcher.Apply()
```

**Root cause**

`ShellSectionRenderer.SendPop` queues the back navigation with
`DispatchQueue.MainQueue.DispatchAsync` in an `async void` callback. The
callback reads `NavigationBar` and calls
`_context.Shell.GoToAsync("..")`, then reads `NavigationBar` again after
the await. It never checks whether the renderer has been disposed in the
meantime.

If the section renderer is disposed before the callback runs (for
example, when the Shell or the current item is torn down right after the
back tap), the callback uses a disposed renderer:
- `NavigationBar` throws `ObjectDisposedException` once the native
controller is released, as in the report.
- `_context` is set to null by `Dispose`, which throws
`NullReferenceException`.

Because the callback is `async void`, either exception is rethrown on
the UIKit synchronization context and crashes the app.

Since #35072 (10.0.90), most back taps no longer go through this
callback: when the top page has a tracker, `SendPop` calls
`Shell.OnBackButtonPressed`, which pops the page itself. The callback
still runs when `OnBackButtonPressed` returns false (for example, an app
override that returns false to keep the default navigation), or when no
tracker matches the top view controller. On 10.0.40, every back tap went
through it.

**Fix**

Return from the queued callback when the renderer has been disposed:
before reading `NavigationBar`, and again after `GoToAsync` returns.
This is the same pattern #36312 applied to the other Shell renderers
that receive late callbacks after disposal (`ShellSectionRootRenderer`,
`ShellFlyoutContentRenderer`, the `ShellSectionRenderer` delegates).
Nothing changes while the renderer is alive.

**Tests**

New iOS/Mac Catalyst device test `DisposedShellSectionIgnoresPendingPop`
in `ShellTests.iOS.cs`, next to the existing "Disposed ... Ignores Late
..." tests:
- It uses a `Shell` whose `OnBackButtonPressed` returns false, so
`SendPop` queues the back navigation.
- It pushes a page, calls `SendPop()`, then disposes the section
renderer before the queued callback runs.
- It runs the queued callback under a test `SynchronizationContext` that
collects the exceptions the `async void` callback posts. That way the
test fails with an assertion instead of crashing the test app.

| Shell device tests (`Category=Shell`, Release) | Without fix | With
fix |
|---|---|---|
| iOS 26.5 simulator | 219 passed, 1 failed: `NullReferenceException` at
`ShellSectionRenderer.<SendPop>b__32_0()` | 220 passed |
| Mac Catalyst | 55 passed, 1 failed (same exception) | 56 passed |

The test covers the first check. I couldn't write a deterministic device
test for the second one (the renderer disposed while `GoToAsync` is
awaited). After that await the callback only reads `NavigationBar`,
which throws only once the native controller has actually been released.
The check covers the same failure as the first one.

#38071 (in `inflight/current`) changes `SendPop` but not this callback,
so the two shouldn't conflict.

### Issues Fixed

Fixes #34087

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
SubhikshaSf4851 and others added 13 commits October 28, 2026 09:51
<!-- 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. !!!!!!!
-->
This pull request improves how the order of `ShellItem` elements is
maintained in the collection, especially during XAML loading, and adds a
test to ensure that setting the `CurrentItem` does not unintentionally
affect the order of implicit shell contents.
### Description of Change
Shell item order handling:

* Added a new method `RestoreDeclarationOrder` in
`ShellElementCollection.cs` to remove and re-add an item, ensuring its
position reflects the original declaration order without triggering
unwanted collection change events.
* Updated `ShellItemCollection.cs` to use `RestoreDeclarationOrder` when
setting the `CurrentItem` for implicit items during XAML loading,
preserving the intended order.

Testing:

* Added a unit test
`CurrentItemDoesNotChangeTheFlyoutOrderOfImplicitShellContents` in
`ShellFlyoutItemGroupTests.cs` to verify that setting the `CurrentItem`
does not change the order of implicit shell contents in the flyout.


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

### Issues Fixed

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

Fixes #29272 

- [x] Windows
- [x] Android
- [x] iOS
- [x] Mac

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="441" height="920" alt="BeforeFix29272"
src="https://github.com/user-attachments/assets/aab4fc64-ab21-4826-a7bf-6543f80ec1b1"
/> | <img width="443" height="923" alt="AfterFix29272"
src="https://github.com/user-attachments/assets/0cc628cc-5cdd-46e3-9379-a13123e246e3"
/> |
<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
…irection with IndicatorTemplate (#39501)

<!-- 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!

### Issue Details
When an IndicatorView is assigned a custom IndicatorTemplate, setting
the FlowDirection property for the IndicatorView causes the indicators
to disappear entirely. Instead of rendering the indicators, the control
appears empty.

### Root Cause
The handler attached the template only during initial connection, so
changing IndicatorTemplate did not replace the displayed native layout.

### Description of Change

<!-- Enter description of the fix in this section -->
* IndicatorViewHandler.cs adds an iOS/MacCatalyst mapping for the
template layout.
* IndicatorViewHandler.iOS.cs replaces the attached template at runtime
and reapplies flow direction.
* MauiPageControl.cs removes only the old template host. Native
indicator views are hidden while a template is active and restored when
it is removed.

### Issues Fixed

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

Fixes #31141 

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

 **Tested the behavior in the following platforms.**
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac

| Before  | After  |
|---------|--------|
| **iOS**<br> <video
src="https://github.com/user-attachments/assets/2f812103-4178-4ccd-9f82-5c0a78f5e66e"
width="300" height="600"> | **iOS**<br> <video
src="https://github.com/user-attachments/assets/f3b1763a-7a71-4fdb-b61d-f6f775e52711"
width="300" height="600"> |

---------

Co-authored-by: sheiksyedm <sheiksyedm@syncfusion.com>
…ion (#39694)

<!-- 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!

### Description of Change

.NET 10 backport of #39691 (targeting `main`).

Fix MAUI's design-time `FontSize` validation so XAML numeric literals
are validated using invariant culture, independently of Windows regional
settings.

The XAML language service uses the design-time converter supplied by
MAUI. Its numeric validation calls the current-culture `double.TryParse`
overload, while MAUI's runtime and XAML compiler use
`NumberStyles.Number` with `CultureInfo.InvariantCulture`. Under
`fr-FR`, or an `en-US` culture with the decimal separator customized to
a comma, valid XAML such as `FontSize="12.5"` is rejected with XLS0431
even though the app builds and runs.

- Use the same invariant numeric parsing settings as the runtime and
XAML compiler.
- Add 13 regression cases covering `en-US`, `fr-FR`, `de-DE`, invariant
decimals and grouping, rejection of localized decimal/grouping
combinations, and a custom comma-decimal regional setting.
- Restore the original culture in `finally` so tests do not leak culture
changes.
- Preserve runtime grouping semantics: `12,5` is not a localized
spelling of 12.5; the runtime interprets it as 125. Runtime parsing and
the XAML language server are unchanged.

The source and test changes are identical to #39691; the converter and
tests are unchanged between `main` and `inflight/current`.

### Issues Fixed

Decimal `FontSize` values can produce false XLS0431 diagnostics and
interfere with XAML Hot Reload when the host uses comma-decimal regional
settings.

Reproduction: change the Windows decimal separator to a comma, restart
Visual Studio, debug a MAUI Windows app, and edit a label to use
`FontSize="12.5"`. A full `de-DE` locale alone may not reproduce the
rejection because its period grouping separator lets the old validator
accept the text.

### Validation

```powershell
dotnet test src\Controls\tests\Core.Design.UnitTests\Controls.Core.Design.UnitTests.csproj --filter FullyQualifiedName~FontSizeDesignTypeConverterTests
```

- Before the production fix: 5 failed, 29 passed (34 total).
- After the production fix: 34 passed, 0 failed.
- `dotnet format whitespace` verification passed for both changed files.
- `git diff --check` passed.

Tests build and run the actual `net472` design tooling on Windows, on
top of `inflight/current` (4606786). A complete Visual Studio Hot
Reload session was not exercised locally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…vedWithShadow UI test failure (#39698)

### Issue Details

The Issue39202 reproduction contains two CollectionViews: one with a
shadow applied to the root Border of the item and another without a
shadow. The CollectionView with the shadow does not respect the safe
area correctly on iOS.

### Root Cause
When the item has a shadow, the safe-area handling does not work
correctly on iOS because the cell's PlatformView is a WrapperView
instead of a MauiView. As a result, the safe-area override is not
updated, the safe-area changes are not detected, and the corresponding
arrange operation is skipped.

This issue was introduced by #37437, which modified the iOS
CollectionView item layout lifecycle to support dynamically rebuilt
content. The new conditional check directly checks whether PlatformView
is a MauiView, preventing the existing ApplyCellSafeAreaOverride helper
from being executed when a shadow wrapper is present.

### Description of Changes

Updated TemplatedCell2.cs to correctly identify the underlying MauiView
for safe-area handling. Added a CellSafeAreaView property to retrieve
the MauiView from either PlatformView or PlatformHandler.PlatformView,
including scenarios where a shadow WrapperView is present.

### Issues Fixed

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

Fixes #39696 

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

**Tested the behavior in the following platforms.**
- [ ] Android
- [ ] Windows
- [x] iOS
- [ ] Mac


| Before  | After  |
|---------|--------|
| **iOS**<br> <img
src="https://github.com/user-attachments/assets/93c7c016-86b3-4b0b-88f8-39703938fbc8"
width="600" height="300"> | **iOS**<br> <img
src="https://github.com/user-attachments/assets/86956f7b-b144-4332-a8d4-8f326070be3d"
width="600" height="300"> |
…e after iOS device rotation #38771 (#39707)

The backport PR #38815 caused LayoutPassesShouldNotIncrease to fail (iOS
18.5) in the previous candidate #38782. This PR #39396 fixed that
failure, and the candidate was subsequently merged into main.

However, the current inflight candidate, #39597, appears to have
overwritten that fix with the earlier backport similar changes, possibly
during conflict resolution, causing LayoutPassesShouldNotIncrease to
fail again.

I have now reverted the conflicting changes
4c29bf0
in the candidate to preserve the fix already present in main.
<!-- 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

On iOS 27, OrientationStateTrigger does not update when the device
rotates. In the reported example, a Grid uses visual states to change
its background color and row/column definitions:

- Portrait: green background, three rows, and one column.
- Landscape: black background, two rows, and two columns.

After rotating to landscape, the Grid remains in its portrait state. The
issue was reported against MAUI 10.0.120 and reproduced using this
checkout's framework sources in Sandbox on an iPhone 18 Pro simulator
running iOS 27.0 with Xcode 27.1.

### Root cause

The iOS DeviceDisplay implementation reads
UIApplication.StatusBarOrientation and subscribes to
DidChangeStatusBarOrientationNotification. On the reproduced iOS 27
configuration, these deprecated APIs no longer provide the expected
orientation value or change notifications.

Consequently, DeviceDisplay continues reporting Portrait with an unknown
rotation, and OrientationStateTrigger does not activate the landscape
visual state even though the native window scene has rotated.

### Fix description

For iOS 27 and later:

- Read interface orientation from the current window scene's
EffectiveGeometry.
- Observe UIDevice.OrientationDidChangeNotification and enable
device-orientation notification generation while display listeners are
active.
- Queue the display-information refresh on the main thread so the scene
can apply its updated orientation.
- Stop generating notifications and dispose the observer when listeners
are removed.

The existing paths for earlier iOS versions and Mac Catalyst remain
unchanged. No public API changes are introduced.



### Issues Fixed

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

Fixes #39693

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- 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. !!!!!!!
-->

### Description of Change

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

Map Windows toolbar `FontImageSource` icons to the native
`AppBarButton.Icon` property using the existing icon converter.
Primary/default items previously put the image in `Content`, leaving the
native icon slot empty; font glyphs were not visible alongside toolbar
text.

This keeps Windows' native glyph-plus-label presentation and leaves the
existing non-font image path unchanged. Adds a Windows device regression
test that checks the glyph, label, empty custom content, and nonzero
native icon layout.

Validation:
- Before the fix, the Windows device regression test failed at runtime
because `AppBarButton.Icon` was null.
- `pwsh .github/skills/run-device-tests/scripts/Run-DeviceTests.ps1
-Project Controls -Platform windows -TestFilter "Category=Toolbar"
-IncludeClasses "Microsoft.Maui.DeviceTests.ToolbarTests" -Rebuild` —
passed after the fix: 12 passed, 0 failed, 5 ignored.
- Built and ran the reporter's
[reproduction](https://github.com/david-maw/NET11SDK-icons) against the
current in-tree MAUI assemblies on Windows 11 ARM64 using a .NET 10 x64
self-contained app. Visually confirmed X + “Letter X”, Y alone, and Z +
“Letter Z”; runtime diagnostics confirmed all three glyphs were loaded
with nonzero layout. The sample was adapted to the installed .NET 10
SDK; .NET 11 and Android were not tested.
- `dotnet format whitespace Microsoft.Maui.sln --no-restore --include
src/Controls/src/Core/Toolbar/Toolbar.Windows.cs
src/Controls/tests/DeviceTests/Elements/Toolbar/ToolbarTests.Windows.cs
--verbosity quiet` — passed.

### Issues Fixed

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

Fixes #39537

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…39710)

<!-- 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. !!!!!!!
-->

### Bug description

When full managed and Java garbage collection occurs without a strong
managed reference
to the activity—for example, from an AndroidX fragment—the registered
launcher wrapper
can be disposed even though the native activity remains alive and
resumed.

Subsequent picker calls fail with:

    System.ObjectDisposedException:
    Cannot access disposed object ...
    AndroidX.Activity.Result.ActivityResultLauncherInvoker

The reporter reproduced this in MAUI 10.0.120 and identified 10.0.100 as
working.
Both picker attempts fail, and the failure persists until the activity
is recreated.

### Root cause

`ActivityForResultRequest<TContract, TResult>` stores per-activity
launchers in a
`ConditionalWeakTable<ComponentActivity, ActivityResultLauncher>`.

A value in this table is retained conditionally on its managed key's
reachability.
Android keeping the native activity alive does not guarantee that the
activity has a
strong managed root. During collection, the launcher wrapper can
therefore become
eligible for finalization and lose its JNI handle while the native
activity and its
result registrations are still valid.

Previously, the launcher was held in a strong field and was not exposed
to this lifetime gap.

### Fix

- Replace the weak-key launcher table with a `ConcurrentDictionary`
using reference equality.
- Strongly retain each activity and its launcher until
`ActivityDestroyed`.
- Remove the registration at the beginning of `ActivityDestroyed`,
including paths with no pending request.
- Preserve independent per-activity requests, pending-request
cancellation, and activity-recreation handling.

No public API changes are introduced.

### Regression

PR #35944


### Issues Fixed

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

Fixes #39700

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copilot-Session: cdc98af7-0509-443d-8a84-cc75ecbc1a1e
…stead of navigating through the gallery (#39730)

<!-- 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!


### Description of Change

Revert #39621 because the direct UI fixture launch changes introduced
increased UI test failures on Android and iOS.

This restores the previous UI testing behavior, including gallery-based
fixture navigation, existing Appium lifecycle handling, and the prior
test infrastructure. The associated direct-launch implementation,
documentation, tests, and project references are removed.

### Issues Fixed

Reverts #39621.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This PR addresses the test failures that occurred in the
inflight/candidate branch: #39597 ,
and includes updates to improve rendering and test stability across
platforms.

This PR adds and updates the expected baseline images for all platforms
so the tests validate the current intended output.
Fixes: #39597

- Set explicit light and dark theme colors for Shell and TabBar in the
Issue38234 test page.
- Updated Issue 23708 and Issue26817_2 to use CollectionView2

#### Images

- 	VerticalStackLayout_Spacing_With_HeightAndWidth
- 	HorizontalStackLayout_Spacing_With_HeightAndWidth
- 	VerticalStackLayout_RTLFlowDirection_With_HeightAndWidth
- 	HorizontalStackLayout_RTLFlowDirection_With_HeightAndWidth
- 	VerticalStackLayout_Spacing_With_Height
- 	VerticalStackLayout_Spacing_With_Width
- 	HorizontalStackLayout_Spacing_With_Width
- 	HorizontalStackLayout_Spacing_With_Height
- 	VerticalStackLayout_RTLFlowDirection_With_Width
- 	VerticalStackLayout_Spacing_With_RTL
- 	VerticalStackLayout_RTLFlowDirection_With_Height
- 	HorizontalStackLayout_Spacing_With_RTL
- 	HorizontalStackLayout_RTLFlowDirection_With_Height
- 	HorizontalStackLayout_RTLFlowDirection_With_Width
- 	VerticalStackLayout_RTLFlowDirection
- 	HorizontalStackLayout_RTLFlowDirection
- 	LightTheme_CheckBox_VerifyVisualState
- 	DarkTheme_Switch_VerifyVisualState
- 	LightTheme_Switch_VerifyVisualState
- 	DarkTheme_RadioButton_VerifyVisualState
- 	LightTheme_SearchBar_VerifyVisualState
- 	LightTheme_Editor_VerifyVisualState
- 	LightTheme_DatePicker_VerifyVisualState
- 	DarkTheme_Slider_VerifyVisualState
- 	DarkTheme_DatePicker_VerifyVisualState
- 	LightTheme_Slider_VerifyVisualState
- 	DarkTheme_Editor_VerifyVisualState
- 	DarkTheme_SearchBar_VerifyVisualState
- 	LightTheme_RadioButton_VerifyVisualState 
-   Issue23708GroupHeaderDoesNotHaveExtraVerticalItemSpacing 
-   TabbedPageSelectedTabColorTest
-   GradientBackgroundsShouldRespectCornerRadiusAcrossVisualStates
-   ScrollViewGradientBackgroundShouldWorkWithScrollView
-   VerifyVSM_CollectionView_Selected_Multiple
-    VerifyVSM_CollectionView_Selected
-  VerifyVSM_CollectionView_InitialState
-  VerifyVSM_CollectionView_Reset
-  VerifyVSM_CollectionView_Normal
-  VerifyVSM_CollectionView_Disable
-  ChangingItemSpacingDoesNotShiftFirstItemOutOfView
-  SelectedItemSetDuringShellNavigationUpdatesVisualState
-  VerifyVerticalItemSpacingPageRendering
-  VerifyIndicatorViewMaximumVisibleWithTemplate
-  IndicatorViewWithTemplatedIcon

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shalini-Ashokan <102292178+Shalini-Ashokan@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: SuthiYuvaraj <92777079+SuthiYuvaraj@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
… through the image service (#39750)

<!-- 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. !!!!!!!
-->

### Description of Change

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

Targets `inflight/candidate` as a follow-up to #39685.

The Windows `ToolbarItemFontIconSourceChangesAtRunTime` screenshot test
failed in candidate PR #39597, with a missing toolbar glyph reported
while the page image continued to render correctly.

For registered app fonts such as FontAwesome, render toolbar icons
through MAUI's existing font-image service and place the resulting image
in `AppBarButton.Icon`. This preserves the icon-plus-label presentation
introduced by #39685 while avoiding native `FontIcon` rendering for
these custom fonts. Default/system fonts retain the native rendering
path.

Image conversion explicitly uses the toolbar's `MauiContext`, since a
replacement image source can be converted before it is attached to its
logical parent.

This is a proposed mitigation: the original CI failure did not reproduce
locally, so its root cause and resolution in CI remain unconfirmed. This
change does not skip the test or update screenshot baselines.



### Issues Fixed

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

Addresses the reported Windows toolbar screenshot failure in #39597
following #39685.
Preserves the icon-plus-text behavior for #39537.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
<!-- 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. !!!!!!!
-->

### Description of Change

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

Draft candidate for .NET MAUI 10 SR13 (10.0.130), using the canonical
`dotnet/maui:inflight/candidate` -> `main` flow.

Snapshot checked on October 23, 2026:

- `inflight/candidate` and `inflight/current`:
`5f4a5154acbeef9aa463938818c1f6d5482f2869`.
- Captured `main`: `1e01690f3040c7ba41b5c2fc25e2eff436f43826`.
- Candidate is 84 commits ahead and 7 behind main. Main is not an
ancestor of this snapshot; the combined merge result requires
validation.
- Candidate version settings retain `PatchVersion=130`,
`SdkBandVersion=10.0.100`, the existing `ci.main` / conditional
`ci.inflight` prerelease labels, and `StabilizePackageVersion=false` by
default.

Keep this PR in draft pending candidate review and CI validation. The
SR13 release branch must be cut from the approved candidate merge while
`PatchVersion` remains 130. Advance main to the next SR cycle only after
that cut. This PR does not cut a release branch, stabilize package
versions, or authorize a release.

The release-readiness survey returned **Conditionally Ready** for main
against the prior SR12 baseline. It reported four `merged-non-main-only`
regression issues and stale main CI. This main-based survey is not
validation of the inflight snapshot or the proposed merge.

Evidence:

- `pwsh -NoProfile -File
.github/skills/release-readiness/scripts/Get-ReleaseReadiness.ps1
-SrBranch release/10.0.1xx-sr12 -Candidate -RegressionLabels
regressed-in-10.0.120,regressed-in-10.0.130 -TrackerKey net10-sr13
-OutputDir
/Users/kubaflo/.copilot/session-state/bc25de00-15f3-4a12-85a6-e5b49f1d9368/files/sr13-readiness
-OutputFormat json` completed successfully.
- `git rev-list --left-right --count
origin/main...origin/inflight/candidate` returned `7 84`.
- `git merge-base --is-ancestor origin/main origin/inflight/candidate`
returned 1: main is not an ancestor.
- Candidate build, device tests, and UI tests have not been run or
verified for this proposed PR. No ship-readiness claim is made.

### Issues Fixed

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

Tracks #39496 without closing the readiness tracker. No individual bug
closure is claimed by this release candidate.

<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Reset patterns:
- global.json
- NuGet.config
- eng/Version.Details.xml
- eng/Versions.props
- eng/common/*

@dotnet-policy-service dotnet-policy-service Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Auto-approved automated inter-branch merge.

Integrate native lifecycle, caching, toolbar icons, bindings and regression tests while retaining net11 APIs, removed platforms, AOT profiles and CV2 baselines.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 Dogfood this PR with:

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

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

Or

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

@kubaflo

kubaflo commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Resolved and pushed all 52 conflicts with net11.0 in ordinary merge commit 52f7c489fb3, on the original merge/main-to-net11.0 branch. No rebase or force-push. The target advanced during validation; its newer tip (b34650315aa) also merges without conflicts.

The resolution integrates incoming lifecycle/icon/binding fixes with net11's existing features:

  • Retained Blazor disconnect guards alongside static-content caching, template routing alongside explicit route-type errors, and SwipeItemView weak subscriptions alongside net11 command-dependency/IsEnabled behavior.
  • Preserved net11 native registrations, tab/badge behavior, Shell overflow handling and iOS safe-area APIs. Windows toolbar font icons retain the native icon slot; badges are overlaid without replacing that icon content.
  • Kept removed Tizen/Compatibility files deleted, Foldable runner mappings intact, and target SDK/dependency/bootstrap configuration unchanged. Retained matched net11 AOT binary profiles and their generated text dumps, rather than mixing .NET 10/.NET 11 profile data.
  • Combined non-overlapping regression tests and public API entries. Kept all 16 conflicting Windows baselines from net11's CV2 implementation. Retained incoming SwipeView-refactor images on Android/iOS and the incoming RTL Shell test image; no snapshots were generated or edited to manufacture passing runtime evidence.

Validation:

  • Native Android Core/Controls build (net11.0-android37.0, PublicApiType=Validate): passed, zero warnings/errors.
  • Managed Blazor suite: 70 passed. Locale/TextToSpeech tests: 24 passed.
  • Selected Controls suite: 372 passed, 1 failed, 2 skipped. The failure is TypedBindingUnitTests.FailToConvert (“No error logged”); the same failure is documented in its originating main change, and both conversion-failure cases pass when run alone. Rerunning the selected set with FailToConvert excluded passed 372 with 2 skipped. This is not an all-green test claim.
  • Android/iOS/WinUI/Mac managed UI-test assemblies: all compiled, zero warnings/errors.
  • All 20 surviving conflicted C# files parsed under five platform-symbol configurations; resolved PowerShell scripts parsed. Scoped formatting passed. The full diff check reports inherited whitespace in incoming, nonconflicted test pages; unrelated formatting was left untouched.

No native Windows/Apple builds, device/UI tests, screenshot captures or XCTest were run. Windows toolbar badges, Apple native compilation and all selected baselines still require native CI/runtime confirmation. These results validate merge integration, not full cross-platform certification.

@github-actions

Copy link
Copy Markdown
Contributor Author

Skill Validation Results

@github-actions[bot] — new skill validation results are available based on this last commit: 52f7c48.
To request a fresh validation after new comments or commits, comment /evaluate-skills.

Overall Passed Static Passed LLM Skipped Skills 28 Agents 7

✅ Skill Validation Results — 52f7c48 · [automated] Merge branch 'main' => 'net11.0' · 2026-10-30T09:53:39Z

✅ Static Checks Passed

Skills: 28 | Eval specs linted: 17

Full lint output
── .github/skills/agentic-labeler/tests/eval.vally.yaml
npm warn deprecated @opentelemetry/sdk-trace-node@2.12.0: Use @opentelemetry/sdk-trace package
npm warn deprecated @opentelemetry/sdk-trace-base@2.12.0: Use @opentelemetry/sdk-trace package
Vally collects pseudonymous usage telemetry (command name, version, outcome, duration, persistent device identifier (when available), and coarse OS/runtime info) to improve the product. No prompts, datasets, file paths, or arguments are collected.
Opt out any time by setting VALLY_TELEMETRY_OPTOUT=1 or DO_NOT_TRACK=1.
Learn more: https://aka.ms/vally/telemetry
✔ .github/skills/agentic-labeler/tests/eval.vally.yaml is valid
── .github/skills/analyze-sessions/tests/eval.vally.yaml
✔ .github/skills/analyze-sessions/tests/eval.vally.yaml is valid
── .github/skills/ci-fix/tests/eval.ownership.vally.yaml
✔ .github/skills/ci-fix/tests/eval.ownership.vally.yaml is valid
── .github/skills/ci-fix/tests/eval.vally.yaml
✔ .github/skills/ci-fix/tests/eval.vally.yaml is valid
── .github/skills/code-review/tests/eval.inline-findings.vally.yaml
✔ .github/skills/code-review/tests/eval.inline-findings.vally.yaml is valid
── .github/skills/code-review/tests/eval.producer-trace.vally.yaml
✔ .github/skills/code-review/tests/eval.producer-trace.vally.yaml is valid
── .github/skills/code-review/tests/eval.trim-aot.vally.yaml
✔ .github/skills/code-review/tests/eval.trim-aot.vally.yaml is valid
── .github/skills/code-review/tests/eval.vally.yaml
✔ .github/skills/code-review/tests/eval.vally.yaml is valid
── .github/skills/code-review/tests/hermeticity.vally.yaml
✔ .github/skills/code-review/tests/hermeticity.vally.yaml is valid
── .github/skills/code-review/tests/soak.capability.vally.yaml
✔ .github/skills/code-review/tests/soak.capability.vally.yaml is valid
── .github/skills/evaluate-pr-tests/tests/eval.vally.yaml
✔ .github/skills/evaluate-pr-tests/tests/eval.vally.yaml is valid
── .github/skills/pr-review/tests/eval.gh-auth.vally.yaml
✔ .github/skills/pr-review/tests/eval.gh-auth.vally.yaml is valid
── .github/skills/review-test-failures/tests/eval.vally.yaml
✔ .github/skills/review-test-failures/tests/eval.vally.yaml is valid
── .github/skills/try-fix/tests/eval.restore.vally.yaml
✔ .github/skills/try-fix/tests/eval.restore.vally.yaml is valid
── .github/skills/try-fix/tests/eval.vally.yaml
✔ .github/skills/try-fix/tests/eval.vally.yaml is valid
── .github/skills/verify-tests-fail-without-fix/tests/eval.protocol.vally.yaml
✔ .github/skills/verify-tests-fail-without-fix/tests/eval.protocol.vally.yaml is valid
── .github/skills/verify-tests-fail-without-fix/tests/eval.vally.yaml
✔ .github/skills/verify-tests-fail-without-fix/tests/eval.vally.yaml is valid

⏭️ LLM Evaluation: Skipped

💡 LLM evaluation was not run for this external PR.
A repository contributor can post /evaluate-skills on this PR to trigger full evaluation.

🔍 Full results and investigation steps

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo
kubaflo disabled auto-merge October 30, 2026 14:07
@kubaflo
kubaflo merged commit c8b279a into net11.0 Oct 30, 2026
20 of 37 checks passed
@kubaflo
kubaflo deleted the merge/main-to-net11.0 branch October 30, 2026 14:08
@github-actions github-actions Bot added this to the .NET 11.0-rc2 milestone Oct 30, 2026
kubaflo pushed a commit that referenced this pull request Nov 2, 2026
… in iOS 18.5 (#39827)

The resaved image was removed for iOS 18.5 and iOS 26.0 in the PR #39768
Later the image was resaved only for iOS 26.0 but not for iOS 18.5 in
the PR #39779
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.