I am using wpf application where i am using an image. I开发者_StackOverflow社区 want to put some animation effects on it. When a user clicks on button it dissapear from the screen and move away from left to right or some this kind of animation. What classes do i need to use. Can I use silverlight or flash or something else here
DoubleAnimation TopAnimation = new DoubleAnimation();
TopAnimation.From = YourImage.Top;
TopAnimation.To = WhereYouWantItToEndUp
TopAnimation.Duration = TimeSpan.FromSeconds(AnDuration);
YourImage.BeginAnimation(YourImage.TopProperty, TopAnimation);
And you can chain a bunch of them together and they will all happen at the same time.
You can also do it in xaml
If you want to know when its completed add a listener to the completed event of the animation
精彩评论