如何在winRT中为动态创建的图像添加跳出效果?

时间:2013-01-15 06:14:46

标签: windows-phone-7 windows-runtime

我的目标是在for循环中为动态创建的图像提供反弹效果。

1 个答案:

答案 0 :(得分:0)

var sb = new Storyboard();
Storyboard.SetTarget(sb, imageTranslateTransform);
sb.RepeatBehavior = RepeatBehavior.Forever;
sb.AutoReverse = true;
var da = new DoubleAnimation();
Storyboard.SetTargetProperty(da, "Y");
da.From = 0;
da.To = 100;
da.Duration = TimeSpan.FromSeconds(1d);
da.EasingFunction = new QuadraticEase {EasingMode = EasingMode.EaseOut};
sb.Children.Add(da);
sb.Begin();