I would like to create a visual effect when an item in the list double-clicks. So far I have a drag and drop function, when an element is visually attached to the mouse and can be moved to the drop target. From this functionality, I can animate an element using the same logic for getting the item container, however I cannot leave the control. Is there a way to remove an item from a ListBox and visually animate it elsewhere? Basically the main list is the hand of cards. When the card double-clicked, I want it to visually move from the manual list to the reset list. At the moment, the logic of moving an item from one collection to another is not a problem, but I would really like the animated visual representation of this event. Any ideas or recommendations on how to do something like this would be appreciated.
Thanks Brandon
Additional information about what I tried: There are some concepts that I still can’t understand, which led me to first launch my face into this wall. I have a method that I pass (some may be optional) to a ListBox as an ItemControl, a FrameworkElement that is a list item, and a data object associated with a ListBox. What I tried to do is FindVisualChild from ListBoxItem, which is the canvas. I can do it. In my opinion, I wanted to somehow clone the canvas either as a canvas or as a bitmap, add it to the children of the page’s child in the same place, remove the ListBoxItem from the ListBox and animate the clone to failure. When the animation is completed, the clone will be deleted or hidden, and since this object will be added to the collection of dumped piles, it will effectively replace the clone.
My problem is that I feel that there really is an easier way to do this using an adorner layer or something like that. I also do not know how I would put the clone in the same position in the element further down the visual tree. I will continue to work on it and explore other approaches, and I just hope that someone will share some information about it.
source share