Canvas 边界 c# ( Windows Phone 7)
Canvas borders c# ( Windows Phone 7)
我正在使用 Storyboard 在 Canvas 中移动我的图像。我想知道是否有一个选项,当图像移动到底部并进入底部边框时图像不会向下移动更多但也不会停留。关键是如何让那个形象沉下去,最后消失?
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)"))
;
我已经解决了这个问题。我只需要在下面创建另一个 canvas 并将 ZIndex 设置为更高的参数
为底部Canvas
Canvas.ZIndex = 1
对于顶部Canvas
Canvas.ZIndex = 0
就是ZIndex的优先级
我正在使用 Storyboard 在 Canvas 中移动我的图像。我想知道是否有一个选项,当图像移动到底部并进入底部边框时图像不会向下移动更多但也不会停留。关键是如何让那个形象沉下去,最后消失?
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)"))
;
我已经解决了这个问题。我只需要在下面创建另一个 canvas 并将 ZIndex 设置为更高的参数
为底部Canvas
Canvas.ZIndex = 1
对于顶部Canvas
Canvas.ZIndex = 0
就是ZIndex的优先级