This is a migrated thread and some comments may be shown as answers.

Implement Swipe Gesture

1 Answer 55 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sebastian
Top achievements
Rank 1
Sebastian asked on 09 Feb 2015, 12:32 PM
Hi,

Im working on a winows phone app, and i have to implement the "delete" functionality using the Swipe Gesture on the item on the list.

I have implemented the Swipe using the "Manipulation" events (ManipulationDelta and ManipulationCompleted), in which i add a RenderTransform (TranslateTransform) to drag the item.

When the user drags the item far enought, i remove it from my model, and the "ItemRemovedAnimation" from the RadDataBoundListBox is fired.
This far, everything Works great.

My problem is:
The control uses UI virtualization, and recycles deleted ítems, so...
when i add a new item to my model, the recylced item is used, and it has a TranslateTransform that makes my new item appear moved to the left, where the user released it to delete.

I need to disable the UI Virtualization, o some how, get the item that has been animated on the ItemAnimationEnded so i can reset the RenderTransform.
Any ideas are appreciated.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 12 Feb 2015, 01:13 PM
Hi Sebastian,

Thank you for contacting us.

I do not have the details of your implementation of this functionality and cannot give you a proper advice, but there are several things that you could consider. First, you should find a way to reset the visual item's state when an item is being removed. Unfortunately, this means that you cannot use the default item animations provided by the DataBoundListBox, because there is no way to find out which element has been removed when the item animation is ended. You can still animate the item that is being removed using the RadAnimationManager. I have attached a sample project that demonstrates how you can implement this functionality, but please note that this solution is very custom and do not guarantee that it would work as expected.

I hope this helps.

Regards,
Rosy Topchiyska
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DataBoundListBox
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or