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.

Bind command on tap

Thread ID:

Created:

Updated:

Platform:

Replies:

127012 Oct 20,2016 04:57 PM Mar 7,2017 07:54 AM Xamarin.Forms 6
loading
Tags: SfRotator
Aster
Asked On October 20, 2016 04:57 PM

Hi,
I'm using your component to display images but i want to add an icommand action when i tap on the image. Obviosly a different behaviour for each image. I've tryied with gestureRecognizer on the image in dataTemplate but the selectedIndex property not updates even with two way binding. Can you help me please?

Aster
Replied On October 21, 2016 04:17 AM

Hi, 

as an addition, i've managed click in this way:

<rotator:SfRotator.ItemTemplate>
                <DataTemplate>
                    <ffimageloading:CachedImage 
                        Aspect="AspectFill" 
                        DownsampleToViewSize="true" 
                        Source="{Binding Image}" 
                        FadeAnimationEnabled="True" 
                        LoadingPlaceholder="Loading.gif">
                        <ffimageloading:CachedImage.GestureRecognizers>
                            <TapGestureRecognizer
                                Command="{Binding Path=BindingContext.TapCommand, Source={x:Reference MainPage}}" 
                                CommandParameter="{Binding .}" />
                        </ffimageloading:CachedImage.GestureRecognizers>
                    </ffimageloading:CachedImage>
                </DataTemplate>
            </rotator:SfRotator.ItemTemplate>
        </rotator:SfRotator>

So, i've used the TapGestureRecognizer with Command Binding on the image inside data template. The only problem is that now, when i try to swipe the image, it executes the tap command so i cannot swipe the rotator anymore.. help me please!

Hemalatha Marikumar [Syncfusion]
Replied On October 21, 2016 06:38 AM

Hi Aster,

Thanks for contacting Syncfusion Support.

We were able to reproduce the issue "Unable to swipe the Rotator's Item with Tapped event on the same  ". A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/

Regards,
Hemalatha M.R.

Robae
Replied On March 5, 2017 01:36 PM

Hi, 
Any news on this issue? I'm facing the same problem that I can't swipe the rotator because the Tap Command is executed.
I'm using version 15.1.0.37

Thanks,


Rathana Kumar Sekar [Syncfusion]
Replied On March 6, 2017 07:32 AM

Hi Ronny,

Thanks for your update.

We were unable to reproduce the reported issue "Unable to swipe Rotator item with adding tapped event on the same in Android" from our side and we have attached the sample with which we checked the reported issue. Please find the sample from the below link.

Sample: http://www.syncfusion.com/downloads/support/forum/127012/ze/RotatorItemTemplate-918501188 

So, could you please provide modified sample which replicates the reported issue as it will help us to provide appropriate solution on this.

Regards,
Rathanakumar S.  


Robae
Replied On March 6, 2017 08:37 AM

Hi,

Thanks for your reply.
The issue happens with your sample as well. However, the VS solution you provided was incorrectly configured. In the "Configuration Properties", the Debug configuration was configured to build and deploy the Release Configuration. This is why the Debug.Writeline statement was never called (or any breakpoints were hit).

Regards,
Ronny

Hemalatha Marikumar [Syncfusion]
Replied On March 7, 2017 07:54 AM

Hi Ronny,

Thanks for your update.

We would like to let you know that the Rotator items are scrollable but on scrolling, the Tap gesture also gets called. Due to this, the image viewer will be showed in scrolling in your scenario. Unlike Touch events, the Tap gesture added to the image controls works separately for android and gets called on tapping even if we have restricted in our source if the scrolling took place. So, we have created a work around to achieve your requirement of tapping and scrolling and please have the sample from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/174438/ze/RotatorItemTemplate-1482414593

Regards,
Hemalatha M.R.


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.

;