I have created a Xamarin Forms Shell App. The app has multiple tabs which route to different pages. On one of the pages I use a CarouselView.
The ItemsSource of the CarouselView is an ObservableCollection<ContentView> inside the ViewModel. The ObservableCollection gets updated via the OnAppearing()-method of the page by calling an update function in the ViewModel. The first time I navigate to the page the CarouselView works fine.
However, when I change the tab and then return to the tab with the CarouselView, the following exception is thrown:
System.IndexOutOfRangeException: 'Can't set CarouselView to position -1. ItemsSource has 3 items.'
This only happens on Android.
Steps to reproduce:
Create Xamarin Forms tabbed shell App
In the first tab add a CarouselView to the page
Update CarouselView inside OnAppearing()
Go to another tab
Return to tab with CarouselView in it
Any workaround would be highly appreciated. Thank you!
