Windows Phone的 - 故事板的TargetName在运行时 [英] Windows Phone - Storyboard TargetName in runtime

查看:118
本文介绍了Windows Phone的 - 故事板的TargetName在运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何设置的T​​argetName有关在运行时DoubleAnimationUsingKeyFrames

How can I set TargetName for DoubleAnimationUsingKeyFrames in runtime?

<Storyboard x:Name="sr">
    <DoubleAnimationUsingKeyFrames x:Name="keyFrameDA" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)"  Storyboard.TargetName="cardBack">
        <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
        <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
    </DoubleAnimationUsingKeyFrames>
</Storyboard>



我曾尝试

I have tried

Storyboard.SetTargetName(keyFrameDA, "cardBack");



但不是DoubleAnimationUsingKeyFrames这些财产。谢谢

But there is not such property for DoubleAnimationUsingKeyFrames. Thanks.

更新
和这个错误是,当我使用这个代码抛出:

Update: And this error is throwing when I am using this code:

Storyboard.SetTargetProperty(keyFrameDa, new PropertyPath(PlaneProjection.RotationXProperty));
Storyboard.SetTarget(keyFrameDa, cardBack.Projection);



错误:KeyFramesProperty - 无法获取现场的KeyFramesProperty的价值,因为对包含类信息不可用

Error: KeyFramesProperty - Cannot fetch the value of field 'KeyFramesProperty' because information about the containing class is unavailable.

推荐答案

好吧,这个怎么样?

Storyboard.SetTargetProperty(keyFrameDa, new PropertyPath(PlaneProjection.RotationXProperty));
Storyboard.SetTarget(keyFrameDa, cardBack.Projection);

这篇关于Windows Phone的 - 故事板的TargetName在运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆