Windows phone 7 故事板WP7-坐标

Windows phone 7 故事板WP7-坐标,windows-phone-7,storyboard,expression-blend,Windows Phone 7,Storyboard,Expression Blend,我已经创建了一个故事板来设置图像控件的动画,该控件以编程方式放置在画布上。故事板是在Expression Blend中创建的 当我播放故事板时,图像消失并在其他地方设置动画(我最终看到图像控件在最后飞入)。它不会在我首先放置图像的位置设置动画。故事板可以工作,但它不能在我想要的地方设置动画。 假设控件在屏幕底部和特定图像的右侧设置动画。这就是为什么我通过代码更改图像的位置 以下是xml: <Storyboard x:Name="sbBagExit"> <Dou

我已经创建了一个故事板来设置图像控件的动画,该控件以编程方式放置在画布上。故事板是在Expression Blend中创建的

当我播放故事板时,图像消失并在其他地方设置动画(我最终看到图像控件在最后飞入)。它不会在我首先放置图像的位置设置动画。故事板可以工作,但它不能在我想要的地方设置动画。 假设控件在屏幕底部和特定图像的右侧设置动画。这就是为什么我通过代码更改图像的位置

以下是xml:

 <Storyboard x:Name="sbBagExit">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.SkewX)" Storyboard.TargetName="imgBag">
            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="11"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="10.9973"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="imgBag">
            <EasingDoubleKeyFrame KeyTime="0" Value="332"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="332"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="332"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="imgBag">
            <EasingDoubleKeyFrame KeyTime="0" Value="-16"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="169.983"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Name="sbBagDrop">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="imgBag">
            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="imgBag">
            <EasingDoubleKeyFrame KeyTime="0" Value="-172"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="332.001"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="344"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="332"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="imgBag">
            <EasingDoubleKeyFrame KeyTime="0" Value="-8"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-8"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-8"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="imgBag">
            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.829"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="imgBag">
            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1.2"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>

第二个故事板紧接着第一个故事板

我已经为这件事抓狂了整整两个星期了。。。。有人能看到我看不到的东西吗


非常感谢您。

因为您使用了Blend来生成动画,所以Blend基于From和to属性的值以及在Blend中使用的元素的坐标和布局

这包括它的容器和边距

因为您没有指定所需的坐标,所以我无法告诉您出了什么问题


我将首先更改TranslateX和TranslateY,以了解它们的功能以及它们何时执行我希望它们执行的操作。

如何在Expression Blend中创建它,以避免出现此错误?使容器和元素与应用它的元素完全相同。我更喜欢只使用相对坐标,因此可以设置动画的“按”属性或“到”属性(不指定“从”属性)。这就避免了那些奇怪的300个数字。