Create a slide down animation/storyboard for an element?
I'd like to create a slide-down animation for an Grid element in my WPF (.net 4.0) application. I assumed that I could do the following:
- create a visual state (closed, renderTranslate.y=-ActualHeight, solved via Binding with converter)
- create a visual state (open, renderTranslate.y=0)
- create a container to开发者_运维问答 clip the animation
- use the default transition
However the binding in (1) seems to be ignored / not evaluated. Apparently VisualStates and Storyboards do not allow DataBinding (however SL4 seems to support them). Any other ideas how to achieve this slide down effect in a XAML-ish way?
An alternative idea I just had: I could write a custom shader that works with relative translation parameters instead of absolute ones. Seems a little bit heavy though.
精彩评论