C#, WPF - Animate item removed from listbox -
this question has answer here:
got xaml code animating when adding item listbox - works great:
<window.resources> <style targettype="{x:type listboxitem}"> <style.triggers> <eventtrigger routedevent="loaded"> <eventtrigger.actions> <beginstoryboard> <storyboard> <doubleanimation storyboard.targetproperty="opacity" from="0" to="1" duration="0:0:2"> </doubleanimation> </storyboard> </beginstoryboard> </eventtrigger.actions> </eventtrigger> </style.triggers> </style> </window.resources>
is there anyway can same when removing item in listbox?
i have an:
observablecollection<string> _data = new observablecollection<string>();
which stores items.
edit: problems seems be, when removing observablecollection item removed first, animation run - nothing displays because item isn't there anymore? right?
best regards
please try write eventtrigger
routedevent
set frameworkelement.unloaded
, inside provide storyboard
Comments
Post a Comment