Skip to content

[Windows] Fix: Border containing SwipeView causes native crash - #36714

Merged
kubaflo merged 1 commit into
dotnet:inflight/currentfrom
SubhikshaSf4851:Fix-36652
Jul 22, 2026
Merged

kubaflo merged 1 commit into
dotnet:inflight/currentfrom
SubhikshaSf4851:Fix-36652

Conversation

@SubhikshaSf4851

@SubhikshaSf4851 SubhikshaSf4851 commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment whether this change resolves your issue. Thank you!

This pull request addresses a native crash on Windows when a SwipeView is placed directly inside a Border. The main fix is to skip applying a geometric clip to the SwipeControl's visual, which avoids the crash. Additional test cases are included to verify the fix.

Description of Change

Bug fix: Preventing native crash with SwipeView inside Border

Test coverage

Issues Fixed

Fixes #36652

Tested the behavior in the following platforms

  • Windows
  • Android
  • iOS
  • Mac
Before Issue Fix After Issue Fix
BeforeFix36652 AfterFix3662

@github-actions

Copy link
Copy Markdown
Contributor

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

Or

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

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Jul 22, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @@SubhikshaSf4851! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@sheiksyedm
sheiksyedm marked this pull request as ready for review July 22, 2026 08:33
Copilot AI review requested due to automatic review settings July 22, 2026 08:33
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI 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.

Pull request overview

Fixes a WinUI native crash on Windows when a SwipeView is placed directly inside a Border by avoiding a problematic geometric clip assignment on the underlying WinUI SwipeControl, and adds a UI test scenario to cover the regression.

Changes:

  • Skip applying a geometric clip in ContentPanel.UpdateClip when the Border content is a WinUI SwipeControl (prevents native crash).
  • Add a HostApp repro page for the Border -> SwipeView -> Content hierarchy.
  • Add an Appium UI test that validates the page loads (i.e., the app does not crash).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Core/src/Platform/Windows/ContentPanel.cs Adds a guard in UpdateClip to avoid setting a geometric clip on SwipeControl visuals (workaround for WinUI crash).
src/Controls/tests/TestCases.HostApp/Issues/Issue36652.cs New HostApp issue page reproducing the Border containing SwipeView crash scenario.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36652.cs New UI test that waits for a result label to confirm the app starts and the page loads.

@kubaflo

kubaflo commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 22, 2026
@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Jul 22, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI Review Summary

@SubhikshaSf4851 — new AI review results are available based on this last commit: 475e154. To request a fresh review after new comments or commits, comment /review rerun.

Gate Passed Confidence Low Platform Windows


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ✅ PASSED

Platform: WINDOWS · Base: main · Merge base: 211a2cc9

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue36652 Issue36652 ✅ FAIL — 613s ✅ PASS — 494s
🔴 Without fix — 🖥️ Issue36652: FAIL ✅ · 613s

Error-relevant lines (filtered from the build log):

     at UITest.Appium.NUnit.UITestBase.UITestBaseTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 159
   at UITest.Appium.NUnit.UITestBase.TestTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 45
🟢 With fix — 🖥️ Issue36652: PASS ✅ · 494s

(no coded error found; showing last 1200 chars)

ion=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 7/22/2026 2:07:34 PM FixtureSetup for Issue36652(Windows)
>>>>> 7/22/2026 2:07:43 PM SwipeViewInsideBorderDoesNotCrash Start
>>>>> 7/22/2026 2:07:44 PM SwipeViewInsideBorderDoesNotCrash Stop
  Passed SwipeViewInsideBorderDoesNotCrash [1 s]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.12]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.32]   Discovered:  Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue36652.trx

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 25.6810 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue36652.trx

📁 Fix files reverted (1 files)
  • src/Core/src/Platform/Windows/ContentPanel.cs

📱 UI Tests — Border,SwipeView,ViewBaseTests

Detected UI test categories: Border,SwipeView,ViewBaseTests

❌ Deep UI tests — 177 passed, 2 failed across 3 categories on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Border 44/44 ✓ —
SwipeView 19/20 (1 ❌) —
ViewBaseTests 114/115 (1 ❌) —
🔍 AI analysis of failures — PR-related vs unrelated

🔍 AI-generated triage (GitHub Copilot CLI) — a heuristic judgement of whether each deep UI test failure is connected to this PR's changes. Verify before relying on it.

Likely PR-related: one or more failures appear connected to this PR's changes.

  • ✗ PR-related — Windows SwipeView behavior (~1 test): Issue36154SwipeViewShouldRevealItems exercises SwipeView on the same Windows platform and control area touched by the PR's ContentPanel change that special-cases SwipeControl, so the reveal/action not invoking is plausibly connected.
  • ● Unrelated — ViewBase clip element timeout (~1 test): the BoxView clip/rotation test times out waiting for an element and does not involve SwipeView/SwipeControl, making it more consistent with an unrelated UI-test timing/discovery failure than this PR's narrow Windows Border+SwipeView clip bypass.

Strongest signal: the only functional change is Windows-only clipping behavior for SwipeControl; re-check the SwipeView failure against a baseline run before treating the BoxView timeout as PR-caused.

❌ SwipeView — 1 failed test
Issue36154SwipeViewShouldRevealItems
Assert.That(App.WaitForElement("ResultLabel").GetText(), Is.EqualTo("RIGHT invoked!"))
  Expected string length 14 but was 29. Strings differ at index 0.
  Expected: "RIGHT invoked!"
  But was:  "Swipe result will appear here"
  -----------^
at Microsoft.Maui.TestCases.Tests.Issues.Issue36154.Issue36154SwipeViewShouldRevealItems() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36154.cs:line 33

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue36154.Issue36154SwipeViewShouldRevealItems() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36154.cs:line 33
❌ ViewBaseTests — 1 failed test
BoxView_ClipWithRotation
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.ClipFeatureTests.BoxView_ClipWithRotation() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ClipFeatureTests.cs:line 1095
   at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHan
...

📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)


📋 Pre-Flight — Context & Validation

Issue: #36652 - [Windows] Border containing SwipeView causes native crash (0xc000027b) with simple content such as Editor or CollectionView
PR: #36714 - [Windows] Fix: Border containing SwipeView causes native crash
Platforms Affected: Windows
Files Changed: 1 implementation, 2 test

Key Findings

  • Root issue: Windows app terminates with native exit code 0xc000027b when the visual hierarchy is Border > SwipeView > Content.
  • PR fix changes src/Core/src/Platform/Windows/ContentPanel.cs so UpdateClip skips assigning a compositor geometric clip when direct Border content is a WinUI SwipeControl.
  • Regression coverage adds a Windows HostApp issue page and an Appium UI test that loads the Border > SwipeView scenario and waits for ResultLabel.
  • Prior inline feedback noted two concerns: use fully-qualified/aliased WinUI SwipeControl type if UI.Xaml.Controls.SwipeControl is unavailable, and consider categorizing the UI test as SwipeView rather than Border.

Code Review Summary

Verdict: NEEDS_DISCUSSION
Confidence: low
Errors: 0 | Warnings: 0 | Suggestions: 0

Key code review findings:

  • ℹ No actionable code findings from independent code review / MAUI expert review.
  • ℹ Blast radius is Windows Border arrange/size-change clipping; no static state or subscriptions added.
  • ℹ Required CI state could not be fully verified due unauthenticated gh, so confidence remains low.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #36714 Skip geometric clipping when direct Border content is WinUI SwipeControl ✅ PASSED (Gate) src/Core/src/Platform/Windows/ContentPanel.cs, 2 test files Original PR fix; gate result supplied by caller

🔬 Code Review — Deep Analysis

Code Review — PR #36714

Independent Assessment

What this changes: Windows ContentPanel.UpdateClip now skips assigning a compositor geometric clip when the direct Border content is a WinUI SwipeControl. The PR also adds a HostApp repro page and UI test for Border > SwipeView.
Inferred motivation: Avoid a WinUI native crash caused by clipping SwipeControl visuals.

Reconciliation with PR Narrative

Author claims: Fixes Windows native crash for SwipeView directly inside Border, with UI coverage.
Agreement/disagreement: Matches the code and linked issue. The workaround is scoped to direct SwipeControl content.

Prior Review Reconciliation

No prior ❌ Error findings found.

Blast Radius Assessment

  • Runs for all instances: No — only Windows Border content clipping where direct content is SwipeControl.
  • Startup impact: Possible page initialization/arrange path, but narrowed to that hierarchy.
  • Static/shared state: No.

CI Status

  • Required-check result: undetermined / pending
  • Classification: undetermined
  • Action taken: gh pr checks --required unavailable due unauthenticated gh; public REST showed some pipeline activity but required-check status was not fully verifiable.

Findings

No code findings. MAUI expert reviewer reported no findings for the actual public PR diff.

Failure-Mode Probing

  • Border contains non-SwipeView content: existing clipping path still runs unchanged.
  • SwipeView is direct Border content: clip assignment is skipped before GetElementVisual, avoiding the native crash path.
  • Null/zero/default shape: existing guards still return safely.
  • Handler reconnect/page reload: no subscriptions or static state added.

Verdict: NEEDS_DISCUSSION

Confidence: low (CI is pending/undetermined; platform UI plumbing maxes at medium even with green CI)
Summary: The code change is narrowly scoped and appears sound. I found no actionable code issues, but cannot give LGTM until required CI is complete and verifiable.


🛠️ Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix Clip the SwipeControl.Content element instead of the SwipeControl visual ⚠️ Blocked 1 file Most visually faithful alternative; preserves shaped clipping in theory, but coordinate behavior unverified
2 try-fix Use compositor InsetClip for direct SwipeControl content ⚠️ Blocked 1 file Avoids GeometricClip; loses rounded/shape fidelity
3 try-fix Defer geometric clipping until SwipeControl.Loaded ⚠️ Blocked 1 file Self-review found major event-subscription lifecycle risk; issue evidence says crash is not just load timing
4 try-fix Use WinUI XAML RectangleGeometry clip instead of compositor clip ⚠️ Blocked 1 file Avoids composition clip pipeline; preserves only rectangular clipping
PR PR #36714 Skip geometric clipping for direct WinUI SwipeControl content ✅ PASSED (Gate) 1 implementation + 2 tests Original PR; only empirically validated fix in this environment

Cross-Pollination

Model Round New Ideas? Details
code-review + maui-expert-reviewer 1 Yes Generated clip-target, clip-type, lifecycle-timing, and XAML-clip alternatives from MAUI platform/layout guidance
iterative loop 2 No After four distinct root-cause hypotheses, remaining variants are trivial permutations of target element or clip type without new evidence

Exhausted: Yes
Selected Fix: PR #36714 — It is the only candidate with a supplied passing gate result. None of the alternatives could be demonstrated better because the Windows HostApp test phase was blocked by missing build-task restore assets after the allowed setup attempt failed.

Environment Blocker

Candidate testing on Windows was blocked after try-fix-1 because BuildAndRunHostApp.ps1 failed before test execution with stale/missing MAUI build tasks. The one setup retry, dotnet build Microsoft.Maui.BuildTasks.slnf --no-restore, failed with NETSDK1004 missing project.assets.json for Controls.Build.Tasks, Resizetizer, and Controls.SourceGen. Per autonomous execution rules, the blocked test phase was skipped and candidate generation continued.

Failure Lessons

  • The direct-content clipping approach is the only alternative that might be visually better than the PR while avoiding the native crash path, but it needs real Windows UI validation.
  • Rectangular clip alternatives trade away rounded Border fidelity and are not clearly better than the PR's conservative no-clip behavior.
  • Load-timing deferral is risky due event lifecycle/subscription cleanup and is contradicted by the PR's stated root cause that the crash occurs regardless of load timing.

🏁 Report — Final Recommendation

Comparative Fix Report — PR #36714

Candidates compared

Candidate Approach Regression result Rank
pr Skip geometric clipping when direct ContentPanel.Content is WinUI SwipeControl. ✅ Passed gate 1
pr-plus-reviewer Same as pr; expert reviewer found no actionable changes. ✅ Passed gate by equivalence 1
try-fix-1 Clip SwipeControl.Content instead of the SwipeControl visual. ⚠️ Blocked/unverified 3
try-fix-2 Use compositor InsetClip for direct SwipeControl content. ⚠️ Blocked/unverified 4
try-fix-4 Use XAML RectangleGeometry clip for direct SwipeControl content. ⚠️ Blocked/unverified 5
try-fix-3 Defer geometric clipping until SwipeControl.Loaded. ⚠️ Blocked/unverified, self-review lifecycle risk 6

Analysis

pr and pr-plus-reviewer are the only candidates with a passing regression gate. The expert review produced no actionable inline findings, so pr-plus-reviewer does not improve on the submitted PR; both candidates have the same implementation, tests, and risk profile.

The try-fix candidates are ranked lower because none reached regression-test validation in this environment. try-fix-1 is the most promising alternative because it attempts to preserve shaped clipping by moving the clip target to SwipeControl.Content, but its coordinate behavior is unverified for nested content and offsets. try-fix-2 and try-fix-4 likely avoid the geometric-clip crash path but trade away rounded/shape fidelity. try-fix-3 is the weakest candidate because deferring until Loaded adds event-subscription lifecycle risk and does not address evidence that the WinUI crash is tied to assigning the geometric clip to SwipeControl, not merely to load timing.

Winning candidate

Winner: pr

The raw PR fix wins because it is the simplest validated fix: it directly avoids the known crashing WinUI geometric-clip path, keeps the change scoped to direct SwipeControl content on Windows, and has the supplied gate result showing the regression test fails without the fix and passes with it. pr-plus-reviewer is functionally identical, so the submitted PR should be kept as-is rather than inventing an empty reviewer-adjusted variant.


🧭 Next Steps — review latest findings

No alternative fix was selected for this run. Review the session findings and CI results before merging.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 22, 2026
@kubaflo
kubaflo changed the base branch from main to inflight/current July 22, 2026 21:27
@kubaflo
kubaflo merged commit 1a3c990 into dotnet:inflight/current Jul 22, 2026
149 of 162 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR10 milestone Jul 22, 2026
kubaflo pushed a commit that referenced this pull request Jul 28, 2026
<!-- 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 addresses a native crash on Windows when a `SwipeView`
is placed directly inside a `Border`. The main fix is to skip applying a
geometric clip to the `SwipeControl`'s visual, which avoids the crash.
Additional test cases are included to verify the fix.

### Description of Change
### Bug fix: Preventing native crash with SwipeView inside Border

*
[`src/Core/src/Platform/Windows/ContentPanel.cs`](diffhunk://#diff-282a53fcf4708a9843eefb152f0572aa6df5de449b7cbaf6c9b49ecbb32fac1eR254-R263):
Updated the `UpdateClip` method to skip applying a geometric clip if the
content is a `SwipeControl`, preventing the WinUI crash described in
[microsoft-ui-xaml#10321](microsoft/microsoft-ui-xaml#10321).

### Test coverage

*
[`src/Controls/tests/TestCases.HostApp/Issues/Issue36652.cs`](diffhunk://#diff-1c90ad4ee58981366523b97489991f0010153a35b637879a61cd94cd36696807R1-R65):
Added a new test page that reproduces the crash scenario by placing a
`SwipeView` directly inside a `Border`.
*
[`src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36652.cs`](diffhunk://#diff-e1e4b9d6eb263aa6fcd679a8f2b181402382e905b4e8073e9cfc944ca29d9b07R1-R19):
Added a UI test to verify that the app does not crash and the result
label is visible when the scenario is loaded.

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

### Tested the behavior in the following platforms

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

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="1919" height="667" alt="BeforeFix36652"
src="https://github.com/user-attachments/assets/fe0752e9-8cfa-45b1-9c80-1f767a3727ca"
/> | <img width="1463" height="821" alt="AfterFix3662"
src="https://github.com/user-attachments/assets/f46b84b6-568b-45b3-9002-821a080456c8"
/> |
<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
kubaflo pushed a commit that referenced this pull request Jul 29, 2026
<!-- 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 addresses a native crash on Windows when a `SwipeView`
is placed directly inside a `Border`. The main fix is to skip applying a
geometric clip to the `SwipeControl`'s visual, which avoids the crash.
Additional test cases are included to verify the fix.

### Description of Change
### Bug fix: Preventing native crash with SwipeView inside Border

*
[`src/Core/src/Platform/Windows/ContentPanel.cs`](diffhunk://#diff-282a53fcf4708a9843eefb152f0572aa6df5de449b7cbaf6c9b49ecbb32fac1eR254-R263):
Updated the `UpdateClip` method to skip applying a geometric clip if the
content is a `SwipeControl`, preventing the WinUI crash described in
[microsoft-ui-xaml#10321](microsoft/microsoft-ui-xaml#10321).

### Test coverage

*
[`src/Controls/tests/TestCases.HostApp/Issues/Issue36652.cs`](diffhunk://#diff-1c90ad4ee58981366523b97489991f0010153a35b637879a61cd94cd36696807R1-R65):
Added a new test page that reproduces the crash scenario by placing a
`SwipeView` directly inside a `Border`.
*
[`src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36652.cs`](diffhunk://#diff-e1e4b9d6eb263aa6fcd679a8f2b181402382e905b4e8073e9cfc944ca29d9b07R1-R19):
Added a UI test to verify that the app does not crash and the result
label is visible when the scenario is loaded.

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

### Tested the behavior in the following platforms

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

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="1919" height="667" alt="BeforeFix36652"
src="https://github.com/user-attachments/assets/fe0752e9-8cfa-45b1-9c80-1f767a3727ca"
/> | <img width="1463" height="821" alt="AfterFix3662"
src="https://github.com/user-attachments/assets/f46b84b6-568b-45b3-9002-821a080456c8"
/> |
<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
kubaflo pushed a commit that referenced this pull request Aug 7, 2026
<!-- 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 addresses a native crash on Windows when a `SwipeView`
is placed directly inside a `Border`. The main fix is to skip applying a
geometric clip to the `SwipeControl`'s visual, which avoids the crash.
Additional test cases are included to verify the fix.

### Description of Change
### Bug fix: Preventing native crash with SwipeView inside Border

*
[`src/Core/src/Platform/Windows/ContentPanel.cs`](diffhunk://#diff-282a53fcf4708a9843eefb152f0572aa6df5de449b7cbaf6c9b49ecbb32fac1eR254-R263):
Updated the `UpdateClip` method to skip applying a geometric clip if the
content is a `SwipeControl`, preventing the WinUI crash described in
[microsoft-ui-xaml#10321](microsoft/microsoft-ui-xaml#10321).

### Test coverage

*
[`src/Controls/tests/TestCases.HostApp/Issues/Issue36652.cs`](diffhunk://#diff-1c90ad4ee58981366523b97489991f0010153a35b637879a61cd94cd36696807R1-R65):
Added a new test page that reproduces the crash scenario by placing a
`SwipeView` directly inside a `Border`.
*
[`src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36652.cs`](diffhunk://#diff-e1e4b9d6eb263aa6fcd679a8f2b181402382e905b4e8073e9cfc944ca29d9b07R1-R19):
Added a UI test to verify that the app does not crash and the result
label is visible when the scenario is loaded.

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

### Tested the behavior in the following platforms

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

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="1919" height="667" alt="BeforeFix36652"
src="https://github.com/user-attachments/assets/fe0752e9-8cfa-45b1-9c80-1f767a3727ca"
/> | <img width="1463" height="821" alt="AfterFix3662"
src="https://github.com/user-attachments/assets/f46b84b6-568b-45b3-9002-821a080456c8"
/> |
<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
kubaflo pushed a commit that referenced this pull request Aug 12, 2026
<!-- 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 addresses a native crash on Windows when a `SwipeView`
is placed directly inside a `Border`. The main fix is to skip applying a
geometric clip to the `SwipeControl`'s visual, which avoids the crash.
Additional test cases are included to verify the fix.

### Description of Change
### Bug fix: Preventing native crash with SwipeView inside Border

*
[`src/Core/src/Platform/Windows/ContentPanel.cs`](diffhunk://#diff-282a53fcf4708a9843eefb152f0572aa6df5de449b7cbaf6c9b49ecbb32fac1eR254-R263):
Updated the `UpdateClip` method to skip applying a geometric clip if the
content is a `SwipeControl`, preventing the WinUI crash described in
[microsoft-ui-xaml#10321](microsoft/microsoft-ui-xaml#10321).

### Test coverage

*
[`src/Controls/tests/TestCases.HostApp/Issues/Issue36652.cs`](diffhunk://#diff-1c90ad4ee58981366523b97489991f0010153a35b637879a61cd94cd36696807R1-R65):
Added a new test page that reproduces the crash scenario by placing a
`SwipeView` directly inside a `Border`.
*
[`src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36652.cs`](diffhunk://#diff-e1e4b9d6eb263aa6fcd679a8f2b181402382e905b4e8073e9cfc944ca29d9b07R1-R19):
Added a UI test to verify that the app does not crash and the result
label is visible when the scenario is loaded.

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

### Tested the behavior in the following platforms

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

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="1919" height="667" alt="BeforeFix36652"
src="https://github.com/user-attachments/assets/fe0752e9-8cfa-45b1-9c80-1f767a3727ca"
/> | <img width="1463" height="821" alt="AfterFix3662"
src="https://github.com/user-attachments/assets/f46b84b6-568b-45b3-9002-821a080456c8"
/> |
<!--
Are you targeting main? All PRs should target the main branch unless
otherwise noted.
-->
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 22, 2026
@sheiksyedm sheiksyedm modified the milestones: .NET 10 SR10, .NET 10 SR11 Aug 26, 2026

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — 475e154d Deployed Jul 22, 2026 by SubhikshaSf4851 via pre_activation #888
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-border Border area-controls-swipeview SwipeView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] Border containing SwipeView causes native crash (0xc000027b) with simple content such as Editor or CollectionView

7 participants