Implement Swipe Gesture

2 posts, 0 answers
  1. Sebastian
    Sebastian avatar
    3 posts
    Member since:
    Feb 2015

    Posted 09 Feb 2015 Link to this post

    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.

  2. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    550 posts

    Posted 12 Feb 2015 Link to this post

    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.

     
  3. DevCraft banner
Back to Top