Repository navigation
[Windows] Fix: Border containing SwipeView causes native crash - #36714
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36714Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36714" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
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. |
|
/azp run maui-pr-uitests |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
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.UpdateClipwhen the Border content is a WinUISwipeControl(prevents native crash). - Add a HostApp repro page for the
Border -> SwipeView -> Contenthierarchy. - 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. |
|
/azp run maui-pr-uitests |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
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.
🗂️ 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):
Issue36154SwipeViewShouldRevealItemsexercises SwipeView on the same Windows platform and control area touched by the PR'sContentPanelchange that special-casesSwipeControl, 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
0xc000027bwhen the visual hierarchy isBorder > SwipeView > Content. - PR fix changes
src/Core/src/Platform/Windows/ContentPanel.cssoUpdateClipskips assigning a compositor geometric clip when direct Border content is a WinUISwipeControl. - Regression coverage adds a Windows HostApp issue page and an Appium UI test that loads the
Border > SwipeViewscenario and waits forResultLabel. - Prior inline feedback noted two concerns: use fully-qualified/aliased WinUI
SwipeControltype ifUI.Xaml.Controls.SwipeControlis unavailable, and consider categorizing the UI test asSwipeViewrather thanBorder.
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
Borderarrange/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
Bordercontent clipping where direct content isSwipeControl. - 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 --requiredunavailable due unauthenticatedgh; 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 |
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 |
1 file | Avoids GeometricClip; loses rounded/shape fidelity |
|
| 3 | try-fix | Defer geometric clipping until SwipeControl.Loaded |
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 |
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. |
3 | |
try-fix-2 |
Use compositor InsetClip for direct SwipeControl content. |
4 | |
try-fix-4 |
Use XAML RectangleGeometry clip for direct SwipeControl content. |
5 | |
try-fix-3 |
Defer geometric clipping until SwipeControl.Loaded. |
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.
<!-- 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. -->
<!-- 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. -->
<!-- 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. -->
<!-- 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. -->
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
SwipeViewis placed directly inside aBorder. The main fix is to skip applying a geometric clip to theSwipeControl'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: Updated theUpdateClipmethod to skip applying a geometric clip if the content is aSwipeControl, preventing the WinUI crash described in microsoft-ui-xaml#10321.Test coverage
src/Controls/tests/TestCases.HostApp/Issues/Issue36652.cs: Added a new test page that reproduces the crash scenario by placing aSwipeViewdirectly inside aBorder.src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue36652.cs: Added a UI test to verify that the app does not crash and the result label is visible when the scenario is loaded.Issues Fixed
Fixes #36652
Tested the behavior in the following platforms