画布边框c#(Windows Phone 7)

时间:2015-06-15 17:26:04

标签: c# windows-phone-7 canvas

我正在使用Storyboard在Canvas中移动我的图像。我想知道是否有一个选项,当Image移动到底部并进入底部边框时Image不会向下移动更多但也不会停留。关键是如何让Image下沉并最终消失?

 DoubleAnimation myAnimation = new DoubleAnimation();
 myAnimation.SpeedRatio = 3;
 myAnimation.AutoReverse = false;
 myAnimation.From = 0;
 myAnimation.To = 700; // Here is 700 but how to make it as I wrote at the top?
 myAnimation.Duration = new Duration(TimeSpan.FromSeconds(2));
 myAnimation.BeginTime = beginTime;
 this.beginTime += TimeSpan.FromMilliseconds(300); 

Storyboard.SetTarget(myAnimation, screenImages[spinedCount, 0]);
Storyboard.SetTargetProperty(myAnimation, new PropertyPath("(Canvas.Top)"))

1 个答案:

答案 0 :(得分:0)

我已经解决了这个问题。我只需在下面创建另一个画布并将ZIndex设置为更高的参数

对于底部画布

Canvas.ZIndex = 1

对于顶级画布

Canvas.ZIndex = 0

它只是ZIndex的优先级