Skip to content

System.AccessViolationException when using SwipeView in a CollectionView on Windows #6153

@pekspro

Description

@pekspro

Description

If a SwipeView is used in a CollectionView, an System.AccessViolationException is thrown on Windows this message.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Demo project

Steps to Reproduce

  1. Create a new MAUI app.
  2. Add this on the main page:
    <CollectionView 
                x:Name="ItemsList"
                ItemSizingStrategy="MeasureFirstItem"
                >
        <CollectionView.ItemTemplate>
            <DataTemplate>
                <SwipeView>
                    <SwipeView.LeftItems>
                        <SwipeItems>
                            <SwipeItem Text="Favorite" BackgroundColor="LightGreen" />
                            <SwipeItem Text="Delete" BackgroundColor="LightPink"
                                />
                        </SwipeItems>
                    </SwipeView.LeftItems>
                    <StackLayout HeightRequest="80">
                        <Label Text="Swipe me!" />
                    </StackLayout>
                </SwipeView>
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>
  1. Initialize the view in the constructor:
	public MainPage()
	{
		InitializeComponent();

		ItemsList.ItemsSource = new string[] { "Hello", "World" }; 
	}

Version with bug

Release Candidate 1 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Windows 10.0.17763.0

Did you find any workaround?

No workaround.

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

area-controls-collectionviewCollectionView, CarouselView, IndicatorViewfixed-in-6.0.300-rc.3Look for this fix in 6.0.300-rc.3!p/1Work that is important, and has been scheduled for release in this or an upcoming sprintplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions