<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"></RowDefinition>
</Grid.RowDefinitions>
<syncCarousel:SfCarousel x:Name="carousel" BindingContext="{Binding CollectionOfItems}" Offset="20" RotationAngle="45" DataSource="{Binding CollectionOfItems}" HeightRequest="400" WidthRequest="800" />
<!--<c:CarouselViewControl x:Name="CaruselViewCon" ItemsSource="{Binding MyDataSource}">
<c:CarouselViewControl.ItemTemplate>
<DataTemplate>
<Image Source="{Binding LabelText}" Aspect="Fill" />
</DataTemplate>
</c:CarouselViewControl.ItemTemplate>
</c:CarouselViewControl>-->
</Grid>
C#:
private ObservableCollection<SfCarouselItem> collectionOfItems; public ObservableCollection<SfCarouselItem> CollectionOfItems { get { return collectionOfItems; } set { collectionOfItems = value; } } public MainPage(Conferance conferance,string userPhone, List<EventDetails> LEventDEtails,List<CPhoto> LPhoto) { InitializeComponent(); collectionOfItems.Add(new SfCarouselItem() { ImageName = LPhoto[0].Path }); collectionOfItems.Add(new SfCarouselItem() { ImageName = LPhoto[1].Path }); collectionOfItems.Add(new SfCarouselItem() { ImageName = LPhoto[2].Path }); carousel.ItemsSource = CollectionOfItems; carousel.BindingContext = CollectionOfItems; }
Wow works well thanks!
is there an exapmle when I touch one of the photos I see it zoom in and zoom out like a web view??
Thanks you for the quick respone your support is great.
another and final question is.
I added 3 photos to my Carusel but it open the 1st one.
I want to opent he 2nd photo when the user open the form.
that is how he can see when he opened the 2 photos on the sides.
how can I do thaT?
SfCarousel sfCarousel = new SfCarousel(); sfCarousel.SelectedIndex = 2; |
Thanks that work for me