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.

SwipeOffset value at EndedEvent

Thread ID:

Created:

Updated:

Platform:

Replies:

130807 Jun 4,2017 02:39 PM Jun 5,2017 05:00 AM Xamarin.Forms 1
loading
Tags: SfListView
Emanuele Filardo
Asked On June 4, 2017 02:39 PM

Hi, the SwipeOffset value at SwipeEndedEventArgs is different from SwipeOffSet of SwipingEventArgs when I stop to swipe, is an issue or is right and I have misunderstood documentation?

As example if I set SfListView.SwipeOffset = 432
during swipe in log I have following values:
111.599983215332 during Swiping
113.599987030029 during Swiping
114.799991607666 during Swiping
115.599990844727 during Swiping
432 at Swipe Ended (stop swipe near at half screen)

If I stop swipe around the half of the screen, I'm expecting a value near 216 and stop or reset swipe template render to 0 since my code call ResetSwipe() if value > 300, instead I get max offset value (432) and the template fill all swiped item row, as attached image

Attachment: templateFillRow_654844c0.7z

Dinesh Babu Yadav [Syncfusion]
Replied On June 5, 2017 05:00 AM

Hi Emanuele, 
 
Thank you for using Syncfusion Products. 
 
We would like to let you know that based on the SwipeThreshold property, the SwipeOffset value is returned in the SwipeEndedEventArgs of SwipeEnded event. The SwipeThreshold (Restricts the layout of swipe view up to a certain position while swiping the item) property indicates that if you have swiped lesser than SwipeThreshold value, then the swiped item is reset automatically and returns “0” in the SwipeOffset value in SwipeEndedEventArgs else if you have swiped greater than SwipeThreshold value, then the swiped item is layout based on the SfListView’s SwipeOffset property and returns the same in the event arguments. This is the actual behavior of SfListView. 
 
So, we could suggest you to achieve your requirement by setting the SwipeThreshold value by which the swiped item is reset automatically if swiped lesser than this value. Also, you can handle the swiping in the Swiping event, If Handled is true, current swipe offset value remain same for the swiped item until the SwipeEnded event is raised as like below code snippet. 
 
Code Example[C#]: 
private void ListView_Swiping(object sender, SwipingEventArgs e) 
{ 
  if (e.SwipeOffSet > 300) 
     e.Handled = true; 
} 
 
For your reference, we have attached the sample and you can download it from the below link. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 
 


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.

;