Reputation: 296
Xamarin.Forms 3.6 has included the CarouselView, so I cant use the nuget package anymore, but shipped version seems to be lacking some features, more specifically indicators seems to be missing entirely?
Here is my old code, which does not compile anymore:
// Create the carousel
_carouselView = new CarouselView()
{
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand,
};
_carouselView.ItemTemplate = template;
_carouselView.SetBinding(ItemsView.ItemsSourceProperty, nameof(_viewModel.CarouselItems));
_carouselView.SetBinding(CarouselView.PositionProperty, nameof(_viewModel.Position));
// Create page-indicator
var indicator = new CarouselIndicators { ItemsSource = _viewModel.CarouselItems };
indicator.Margin = new Thickness(20, 20, 20, 0);
indicator.SetBinding(CarouselIndicators.PositionProperty, nameof(_viewModel.Position));
CarouselView.Position and CarouselIndicators are not there in 3.6 :( Do I need to implement indicators manually in 3.6?
Upvotes: 0
Views: 689
Reputation: 56
As Xamarin.Forms 3.6 includes an implementation of CarouselView, if you upgrade from using Xamarin.Forms<3.6 and Xamarin.Forms.CarouselView to Xamarin.Forms 3.6 it is going to break. Because
Position
propertyA lot of projects switched to a community implementation of CarouselViews :
Solution for you would be :
_carouselView.SetBinding(CarouselView.PositionProperty, nameof(_viewModel.Position));
to
_carouselView.SetBinding(CardsView.SelectedIndexProperty, nameof(_viewModel.Position));
Upvotes: 4