FrayxRulez / SwipeListView

A ListView with swipe handling like the one in new Outlook Mail app for Windows 10.
MIT License
99 stars 29 forks source link

Cancel ItemSwipe operation #14

Closed maxstricker closed 7 years ago

maxstricker commented 7 years ago

Hi,

how can I cancel the swipe inside SwipeListView_ItemSwipe and reset the view to look like initially. Lets say a user swipes right, inside the SwipeListView_ItemSwipe I want to check if the operation is possible and return if some condition is not satisfied. How can I reset the visual layout to the one before swiping? I found SwipeListViewItem.ResetSwipe() which could be the method I need, but inside the SwipeListView_ItemSwipe I am unable to get the current SwipeListViewItem. Any ideas?

FrayxRulez commented 7 years ago

You can use ListView.ContainerFromItem method to get the SwipeListViewItem from the e.SwipedItem property

maxstricker commented 7 years ago

Perfect, thanks. Appreciate the fast response.