c# - Animating removed item in Listbox -


I have some listboxes, which are tied to the obsolete poll in my app, and I would like to revise an item if It is being removed

I have already got a question about how to animate the added item using Framework Element.loaded event, but surely it will be accompanied by fluctuating events. not working.

Is there a way to be used in a data template like this?

EDIT: I have tilted the archive playful event in my itemsSource and have tried to apply the animation manually. Currently it looks like this:

  ListBoxItem items = stack.ItemContainerGenerator.ContainerFromIndex (0) As ListBoxItem; Item.LayoutTransform = New Scale Transform (1, 1); Double animation scale animation = new double animation (); ScaleAnimation.From = 1; ScaleAnimation.To = 0; ScaleAnimation.Duration = New duration (new timespan (0, 0, 0, 0, 500)); Scale Transform Transform = (Scale Transform) Item. Layout transforms; Transform. Benz Animation (Scale Transform. Scale Y Property, Scale Animation);  

The problem is, it does not work at all. When the method is called whenever the item still pops away, the item is still there, so it should not play the animation before it disappears? Or am I doing it completely wrong?

I have solved it by connecting the IRemoved property to bound objects. In the listViewItem container template, an event trigger is triggered when it runs the deletion animation, when this button changes in the right, concurrently starts with a task job. Della (N) matches with the duration of the animation, and follows with actual removal from the collection. Note that this removal must be sent to the owner's thread in the list to avoid the exception of a formula thread.

  Remove zero (mitm item, iLIT  list) {item.IsRemoved = true; Work. Resource. STARTNU ((=) = & gt; {ACTION (ANIMATION_LENGTH_MS); Dispatcher. Invoke (new action (=) = & gt; list. Remove (item));}); }  

Comments