- Home
- Forum
- Xamarin.Forms
- SfCarousel is not showing
SfCarousel is not showing
Hi
I am trying to add a SF Carousel however it does not showing any photo
attaching my code for some help:
XAML:
<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; }
SIGN IN To post a reply.
7 Replies
ET
Eswaran Thirugnanasambandam
Syncfusion Team
August 18, 2017 11:20 AM UTC
Hi Barak Rozenfeld,
Thanks for contacting Syncfusion Support.
We have checked the reported issue "SfCarousel is not showing" from our side with our latest build. The ImageName API can be used to display the images that are inside the Resource folder. For displaying the image from the URI, we should not give the URI directly to ImageName instead we must add the online images to the ItemContent using the ImageSource.FromUri. We have prepared the sample based on your requirement. Please find the sample from the below link.
Sample:
http://www.syncfusion.com/downloads/support/directtrac/185726/ze/132158carouselForum-815634179
Thanks for contacting Syncfusion Support.
We have checked the reported issue "SfCarousel is not showing" from our side with our latest build. The ImageName API can be used to display the images that are inside the Resource folder. For displaying the image from the URI, we should not give the URI directly to ImageName instead we must add the online images to the ItemContent using the ImageSource.FromUri. We have prepared the sample based on your requirement. Please find the sample from the below link.
Sample:
http://www.syncfusion.com/downloads/support/directtrac/185726/ze/132158carouselForum-815634179
Please let us know if you have any other query.
Regards,
Eswaran AT.
Regards,
Eswaran AT.
BR
Barak Rozenfeld
August 18, 2017 02:30 PM UTC
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??
ET
Eswaran Thirugnanasambandam
Syncfusion Team
August 21, 2017 01:19 PM UTC
Hi Barak Rozenfeld,
Thanks for your update,
Currently we don’t have built-in option to have a zoom in feature on clicking the Carousel Item. We can achieve this requirement by adding a TapGesture to the ImageView in the Sample and based on the tapped event we can open the image in another overlay control. We have prepared the sample based on your requirement. In the provided sample, we have added gesture recognizer through which on clicking an Alert Window is shown which can be replaced with an overlay control with image.
Link:
http://www.syncfusion.com/downloads/support/forum/132158/ze/Carouseltester1055809892
Thanks for your update,
Currently we don’t have built-in option to have a zoom in feature on clicking the Carousel Item. We can achieve this requirement by adding a TapGesture to the ImageView in the Sample and based on the tapped event we can open the image in another overlay control. We have prepared the sample based on your requirement. In the provided sample, we have added gesture recognizer through which on clicking an Alert Window is shown which can be replaced with an overlay control with image.
Link:
http://www.syncfusion.com/downloads/support/forum/132158/ze/Carouseltester1055809892
Please let us know if you have any other query.
Regards,
Eswaran AT.
BR
Barak Rozenfeld
August 23, 2017 08:43 AM UTC
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?
RB
Rabhia Beham Kathar Mideenar
Syncfusion Team
August 24, 2017 10:07 AM UTC
Hi Barak Rozenfeld,
Thanks for your update,
Query: when I touch one of the photos I see it zoom in and zoom out like a web view.
We are glad to hear that you have achieved your requirement.
Query: I want to open the 2nd photo when the user open the form.
Your requirement has been achieved by using "SelectedIndex" property in Carousel control.By default,it has been taken "0" as index of carousel control.
SelectedIndex: Bring the desired item into our view .
Code Example:
Thanks for your update,
Query: when I touch one of the photos I see it zoom in and zoom out like a web view.
We are glad to hear that you have achieved your requirement.
Query: I want to open the 2nd photo when the user open the form.
Your requirement has been achieved by using "SelectedIndex" property in Carousel control.By default,it has been taken "0" as index of carousel control.
SelectedIndex: Bring the desired item into our view .
Code Example:
|
SfCarousel sfCarousel = new SfCarousel(); sfCarousel.SelectedIndex = 2; |
We have prepared the sample based on your requirement.Please find the sample from the below link.
Link: http://www.syncfusion.com/downloads/support/forum/132158/ze/Carouseltester_2162680503
Link: http://www.syncfusion.com/downloads/support/forum/132158/ze/Carouseltester_2162680503
Please let us know if you have any query.
Regards,
Rabhia Beham K.
BR
Barak Rozenfeld
September 28, 2017 07:19 AM UTC
Thanks that work for me
ET
Eswaran Thirugnanasambandam
Syncfusion Team
September 29, 2017 10:14 AM UTC
Hi Barak Rozenfeld,
Thanks for your update.
We are glad to hear that you have achieved your requirement. Please let us know if you need further assistance.
Regards,
Eswaran AT.
Thanks for your update.
We are glad to hear that you have achieved your requirement. Please let us know if you need further assistance.
Regards,
Eswaran AT.
SIGN IN To post a reply.
- 7 Replies
- 3 Participants
-
BR Barak Rozenfeld
- Aug 17, 2017 08:46 AM UTC
- Sep 29, 2017 10:14 AM UTC