[Bug] CollectionView ItemSource bound to ObservableCollection not updating on collection update #2045
Labels
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
p/2
Work that is important, but is currently not scheduled for release
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Projects
Milestone
Description
A CollectionView ItemsSource is bound to an ObservableCollection.
The ObservableCollection is populated with an async call to an endpoint on application start.
Adding items in the collection is not reflected in the UI.
Steps to Reproduce
Expected Behavior
CollectionView updating according to the underlying ObservableCollection when the application starts.
Actual Behavior
CollectionView does not update according to the underlying ObservableCollection.
If the user scrolls the view in the emulator or the physical device, the CollectionView is correctly displayed.
Basic Information
Version with issue: Maui Preview 6
Last known good version: N/A (code works with Xamarin.Forms)
IDE: Visual Studio 2022 (Version 17.0.0 Preview 2.1)
Platform Target Frameworks:
Affected Devices: emulator and physical device
Reproduction Link
https://github.com/antigones/MAUI-ToDoApp
Workaround
After fetching the items and adding them to the underlying ObservableCollection, simulate user scrolling CollectionView with:
_cvToUpdate.ScrollTo(1);
_cvToUpdate.ScrollTo(0);
where _cvToUpdate is the CollectionView.
The text was updated successfully, but these errors were encountered: