Xamarin.forms: [UWP] Forms loses the correct reference to the cell after adding and removing items to a ListView

Created on 24 Aug 2018  路  2Comments  路  Source: xamarin/Xamarin.Forms

Description

UWP loses the correct reference to the cell after adding and removing items to a ListView.

I found this related bug on bugzilla with a nice sample: https://bugzilla.xamarin.com/show_bug.cgi?id=42999, I have updated the sample and uploaded to a git repo here: https://github.com/giusepe/UWPContextActionsBug

Steps to Reproduce

  1. Run the sample on UWP
  2. Add Item 4 (top button)
  3. Remove Item 4 (Context Menu)

Expected Behavior

Item 4 to be removed

Actual Behavior

Item 4 will still visible
When you try to toggle it to read, the app crashes

Works on iOS and Android as expected.

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:

    • iOS:

    • Android:

    • UWP: 16299

  • Android Support Library Version:
  • Nuget Packages:
    Xamarin.Forms 3.1.0.697729
    Microsoft.NETCore.UniversalWindowsPlatform 6.1.7

  • Affected Devices: Only tried on a Windows PC (x86)

Screenshots

Reproduction Link

https://github.com/giusepe/UWPContextActionsBug

UWP bug

All 2 comments

In order to reproduce the issue, I had to:

  • Run the sample on UWP
  • Remove Item 3 (via Context Menu)
  • Add Item 4 (top button)
  • Remove Item 4 (Context Menu) (will still be visible)

After that, attempting to set Item 4 to 'read' via the context menu causes a crash.

Ops, sorry @hartez for the wrong directions, I made this so many times to figure out and in the end, I wrote it wrong.

Was this page helpful?
0 / 5 - 0 ratings