开发者

Create a slide down animation/storyboard for an element?

开发者 https://www.devze.com 2023-01-18 05:46 出处:网络
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:

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:

  1. create a visual state (closed, renderTranslate.y=-ActualHeight, solved via Binding with converter)
  2. create a visual state (open, renderTranslate.y=0)
  3. create a container to开发者_运维问答 clip the animation
  4. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消