是否有任何简单的方法可以正常运行基于WPF故事板的动画,然后反向运行以将所有内容恢复到原始状态?
最好,我想以编程方式执行此操作:
Storyboard sb=new Storyboard();
...
sb.Begin();
// Now how to do I run sb in reverse, to move things to where they were
// before the sb started?
例如,您可能有一个动画,其中椭圆从左向右移动,并且您希望它在结尾处向后移动到它开始的位置:
答案 0 :(得分:5)
您是否尝试过将AutoReverse
设置为true
?
答案 1 :(得分:0)
Storyboard sb=new Storyboard();
sb.AutoReverse=true;
...
sb.Begin();
// Now how to do I run sb in reverse, to move things to where they were
// before the sb started?