Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Fix crash using SwipeView inside CollectionView #6220

Merged
merged 4 commits into from
Apr 25, 2022
Merged

Conversation

jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Apr 19, 2022

Description of Change

Fix crash using SwipeView inside CollectionView on Windows.

Issues Fixed

Fixes #6153
Fixes #6401

bool CanMeasureContent(FrameworkElement frameworkElement)
{
// Measure the SwipeControl before has loaded causes a crash on the first layout pass
if (frameworkElement is SwipeControl swipeControl && !swipeControl.IsLoaded)
Copy link
Member

Choose a reason for hiding this comment

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

Is this exclusive to SwipeControl? Should this just check for a Control that IsLoaded ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A far as I reviewed cannot Measure the SwipeControl with left or right items before is loaded, but, not happens in the rest of the controls.

@LanceMcCarthy
Copy link

Looking forward to this fix! Thanks Javier.

@Redth Redth merged commit c785ec6 into main Apr 25, 2022
@Redth Redth deleted the fix-6153 branch April 25, 2022 19:37
@SamuelJames101
Copy link

SamuelJames101 commented Jun 26, 2023

What .net Version did this come into? As I am using .net 7.0.3 and I can still see the exception on Windows
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'" when I have a swipe view in the XAML @jsuarezruiz

@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants