[Windows] Fix horizontal swipes not working when SwipeItems are set in all directions#24
Draft
[Windows] Fix horizontal swipes not working when SwipeItems are set in all directions#24
Conversation
This reverts commit 138797f.
Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Windows] Horizontal swipes not working when SwipeItems are set in all directions
[Windows] Fix horizontal swipes not working when SwipeItems are set in all directions
Jul 31, 2025
546914f to
513755f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
This PR fixes an issue on Windows where horizontal swipes (left/right) would not work when SwipeItems are configured for all four directions (LeftItems, RightItems, TopItems, and BottomItems) on a SwipeView.
Root Cause
The issue was caused by a timing inconsistency in the Windows SwipeView handler:
MapTopItemsandMapBottomItemsmethods were setting SwipeItems immediately when calledMapLeftItemsandMapRightItemsmethods were deferring the setting until after the control'sIsLoadedeventThe
OnLoadedevent handler was only updating LeftItems and RightItems, leaving TopItems and BottomItems to be set at a different time, which interfered with the horizontal swipe functionality.Solution
The fix ensures consistent timing by:
IsLoadedchecks toMapTopItemsandMapBottomItemsmethods to defer their execution until the control is loadedOnLoadedmethod to include TopItems and BottomItems alongside LeftItems and RightItemsChanges Made
SwipeViewHandler.Windows.csto defer all SwipeItems setting until after control loadIssue23.csto verify the fix and prevent regressionsTesting
The fix includes both a HostApp test page and automated UI tests that verify:
Fixes #23.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
11vvsblobprodcus336.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)1p7vsblobprodcus324.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)4zjvsblobprodcus390.vsblob.vsassets.iodotnet build src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj --framework net9.0-android(dns block)dotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)6s7vsblobprodcus313.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)ajhvsblobprodcus363.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)d0svsblobprodcus381.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)e7bvsblobprodcus348.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)kxqvsblobprodcus376.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)m16vsblobprodcus374.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)o3svsblobprodcus318.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)rcxvsblobprodcus328.vsblob.vsassets.iodotnet test src/Core/tests/UnitTests/Core.UnitTests.csproj --filter *SwipeView* --verbosity normal(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.