silverlight - Disabling a EventTrigger\Storyboard Dynamically -
<grid.triggers> <eventtrigger routedevent="border.loaded"> <eventtrigger.actions > <beginstoryboard> <storyboard x:name="mystoryboard" autoreverse="true" repeatbehavior="forever"> <coloranimationusingkeyframes begintime="00:00:00" storyboard.targetname="border" storyboard.targetproperty="(border.background).(solidcolorbrush.color)"> <splinecolorkeyframe keytime="00:00:01" value="#fffafafa"/> </coloranimationusingkeyframes> </storyboard> </beginstoryboard> </eventtrigger.actions> </eventtrigger> </grid.triggers>
how enable\disable event trigger\animation dynamically. thinking bind ivalueconverter , disable storyboard, there not seem suitable property bind to?
the trigger available in silverlight "loaded", other events you'll have write bit of code. use technique, storyboards should go in resources section instead of triggers, , you'll call begin() on storyboard code.
if you're doing templating of control, there called transitions let kick off storyboards based on control events, mouseover. handled visual state manager:
http://timheuer.com/blog/archive/2008/06/04/silverlight-introduces-visual-state-manager-vsm.aspx
Comments
Post a Comment