WPF routedevent storyboard begin only if height is zero -
i have following xaml border trigger uses routed event
<border.triggers> <eventtrigger routedevent="mouseleftbuttonup" enteractions=""> <beginstoryboard> <storyboard> <objectanimationusingkeyframes begintime="0" duration="0:0:0.4" storyboard.target="{binding elementname=messagewriterdefinition}" storyboard.targetproperty="height"> <discreteobjectkeyframe > <discreteobjectkeyframe.value> <gridlength>20</gridlength> </discreteobjectkeyframe.value> </discreteobjectkeyframe> ... </objectanimationusingkeyframes> </storyboard> </beginstoryboard> </eventtrigger> </border.triggers> this trigger fires when border , containing elements clicked , animates cause target animate open height of 0 200
the trigger works each time border receives event animation runs , target animates open again (even if open)
how can 1 add condition trigger ignores animation target has height greater zero?
you may use doubleanimation instead of objectanimationusingkeyframes. setting to property, not from, animation starts current property value. requires set initial value of height of border:
<border height="20" ...> <border.triggers> <eventtrigger routedevent="mouseleftbuttonup"> <beginstoryboard> <storyboard> <doubleanimation storyboard.targetproperty="height" to="200" duration="0:0:0.4"/> </storyboard> </beginstoryboard> </eventtrigger> </border.triggers> </border>
Comments
Post a Comment