alexrainman / CarouselView

CarouselView control for Xamarin Forms
MIT License
436 stars 176 forks source link

My carousel no change of position when i set the value of property from code #554

Closed fpsoto closed 3 years ago

fpsoto commented 4 years ago

HI!:

Im have a carousel where the user can see samples, these samples are added one by one, and the user could see the last one created each time that he press the button, in android the project works fine, but in iOS the carols has a very strange behavior, because when user press button add(see below) in the carousel only appears the first and last elements in the item source :S

I attached some code to understand better this situation.

xmla page

 <controls:CarouselViewControl x:Name="cvSamplings" ItemsSource="{Binding ListSamplings, Mode=TwoWay}" PositionSelected="cvSamplings_PositionSelected"
                                          Orientation="Horizontal" InterPageSpacing="10" Position="{Binding MyPosition,Mode=TwoWay}"                                        
                                          VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">

code to change current position var index = viewModel.AddSample(); BindCarouselView(); viewModel.MyPosition = index;