开发者

How to animate visibility of a StackPanel in Silverlight to expand and collapse?

开发者 https://www.devze.com 2023-01-07 06:56 出处:网络
In my case, I would like the expand/collapse to happen from left to right and开发者_高级运维 right to left respectively.

In my case, I would like the expand/collapse to happen from left to right and开发者_高级运维 right to left respectively.

The animation should happen when the visibility changes.

Thank you.


You could create two animation storyboards (One for expanding and one for Collapsing) that animates the Width of the stackpanel, then on StackPanel_VisibilityChanged run the appropriate animation.


I recommend animating on the Width property rather than ScaleX. Otherwise the entire control (StackPanel) will look crunched/stretched as its animating.

0

精彩评论

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