We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

SfCarousel is not showing

Thread ID:

Created:

Updated:

Platform:

Replies:

132158 Aug 17,2017 04:46 AM Sep 29,2017 06:14 AM Xamarin.Forms 7
loading
Tags: SfCarousel
Barak Rozenfeld
Asked On August 17, 2017 04:46 AM

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;
 }

Eswaran Thirugnanasambandam [Syncfusion]
Replied On August 18, 2017 07:20 AM

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 
  
Please let us know if you have any other query.

Regards,
Eswaran AT.  


Barak Rozenfeld
Replied On August 18, 2017 10:30 AM

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??



Eswaran Thirugnanasambandam [Syncfusion]
Replied On August 21, 2017 09:19 AM

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 

Please let us know if you have any other query.

Regards, 
Eswaran AT. 


Barak Rozenfeld
Replied On August 23, 2017 04:43 AM

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?



Rabhia Beham Kathar Mideenar [Syncfusion]
Replied On August 24, 2017 06:07 AM

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: 

  
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 

Please let us know if you have any query. 

Regards,
Rabhia Beham K. 



Barak Rozenfeld
Replied On September 28, 2017 03:19 AM

Thanks that work for me


Eswaran Thirugnanasambandam [Syncfusion]
Replied On September 29, 2017 06:14 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;