Bug 57897 - ObservableCollection does not update ListView in UWP
Summary: ObservableCollection does not update ListView in UWP
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.5
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-07-01 05:45 UTC by Adam
Modified: 2018-02-20 14:55 UTC (History)
3 users (show)

Tags: ac uwp listview observablecollection itemssource binding
Is this bug a regression?: ---
Last known good build:


Attachments
Updating ListView via ObservableCollection (172.78 KB, application/x-zip-compressed)
2017-07-01 05:45 UTC, Adam
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 57897 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Adam 2017-07-01 05:45:03 UTC
Created attachment 23248 [details]
Updating ListView via ObservableCollection

When you bind a ListView to an ObservableCollection, in Android it successfully updates the listview each time you update the ObservableCollection, but it doesn't in UWP.

It will work however, if you make sure you are updating the ObservableCollection in the UI Thread. It's not a major bug, but it's a discrepancy between UWP and other platforms, as I believe, just with INPC, it should ensure it's on the right thread when going to the UI.
Comment 1 Jimmy [MSFT] 2017-07-05 16:25:36 UTC
I was able to reproduce this issue using the attached project. This issue appears to happen when updating the ObservableCollection via a background thread so as mentioned in the description, making the update on the UI thread resolves the issue.


### Version Test
2.3.6.114   BAD
2.3.5-pre6  BAD
Comment 2 Sascha Martinetz 2018-02-20 14:55:19 UTC
Bug seems to still exist in 2.5.0.280555