Hi,
I have made a new simpliest project and i have same behavior.
In the view a simple carousel with label:
<ContentPage.Resources>
<ResourceDictionary>
<DataTemplate x:Key="PostItemTemplate">
<Grid x:Name="GridGlob" BackgroundColor="Green" Margin="5">
<Label Grid.Row="1" Text="{Binding .}" />
</Grid>
</DataTemplate>
</ResourceDictionary>
</ContentPage.Resources>
<CarouselView BackgroundColor="Pink" ItemTemplate="{DynamicResource PostItemTemplate}"
x:Name="carou" Loop="False" ItemsSource="{Binding LesItems}" PeekAreaInsets="50">
in the viewmodel
private ObservableCollection<string> _LesItems;
public ObservableCollection<string> LesItems
{
get { return _LesItems; }
set { _LesItems = value;
OnPropertyChanged();
}
}
Now just add a button in the view with command binding viewmodel doing this:
ObservableCollection<string> obsCol = new ObservableCollection<string>();
obsCol.Add("ble");
obsCol.Add("sdf");
obsCol.Add("erz");
obsCol.Add("grz");
obsCol.Add("efs");
obsCol.Add("new");
LesItems = obsCol;
since Xamarin forms 5.0.0.2291:
First time, everything is good, 6 items are drawn . If you clic again , You will see only 4 items and most of time only 1 item (debug show that "LesItems" contains 6 items but only 1 is drawn)
With old Xamarin forms 5.0.0.224:
It always works fine. No matter number of clic. all items are drawn that should be normal behaviour because each time you clic it must replace collection by nex one and drawing all items.
Thanks for your help