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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Want to use a "long press" effect in SfRotator or on any item in the rotator

Thread ID:





142669 Feb 14,2019 11:39 AM UTC Feb 20,2019 03:50 AM UTC Xamarin.Forms 3
Tags: SfRotator
Asked On February 14, 2019 11:39 AM UTC

With this https://alexdunn.org/2017/12/27/xamarin-tip-xamarin-forms-long-press-effect/ you can define a "LongPressEffect" to bind to any Element in forms to intercept a "long press". This works fine on Xamarin standard controls but not on a SfRotator. I tried to use it on a label inside a rotator item, this also does not work.

This works if not used in a SfRotator item:
<Label effects:LongPressedEffect.Command="{Binding BindingContext.LongPressCommand}">
<effects:LongPressedEffect />
This is the label to press long!

Even this does not work:
effects:LongPressedEffect.Command="{Binding LongPressCommand}"
SelectedDotColor="{StaticResource Blue}"
UnselectedDotColor="{StaticResource CustomLightGray}">

<effects:LongPressedEffect />

I added a OnPropertyChanged handler to the sample to see the binding set of the command. In the cases it does not work this does not get called.

Dhanasekar R [Syncfusion]
Replied On February 18, 2019 12:42 PM UTC

Hi Bernd, 
Greetings from Syncfusion. 
We have checked your requirement on SfRotator for using Effect, we can provide ItemTemplate for the SfRotator, where we can use the effect which we need. 
<syncfusion:SfRotator x:Name="rotator">
       <Label Text="Long Press Me!" local:LongPressedEffect.Command="{Binding NewCommand}">
                <local:LongPressedEffect />

Please check with the above case and let us know if you have clarification on this. 
If your requirement is differ from the above solution, please update us with more details link issue replication sample. This will be helpful for us to provide better solution on this. 

Replied On February 18, 2019 01:46 PM UTC

Thank you very much - it works.

Reason was the binding inside a ControlTemplate so the binding was not failed, but not found during runtime.

Dhanasekar R [Syncfusion]
Replied On February 20, 2019 03:50 AM UTC

Hi Bernd, 
Glad that the solution works. Please get back to us if any further assistance on this. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon