【发布时间】:2012-09-23 12:48:21
【问题描述】:
如何在运行时为 DoubleAnimationUsingKeyFrames 设置 TargetName?
<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>
我试过了
Storyboard.SetTargetName(keyFrameDA, "cardBack");
但 DoubleAnimationUsingKeyFrames 没有这样的属性。谢谢。
更新: 当我使用这段代码时会抛出这个错误:
Storyboard.SetTargetProperty(keyFrameDa, new PropertyPath(PlaneProjection.RotationXProperty));
Storyboard.SetTarget(keyFrameDa, cardBack.Projection);
错误:KeyFramesProperty - 无法获取字段“KeyFramesProperty”的值,因为有关包含类的信息不可用。
【问题讨论】:
标签: c# windows-phone-7 xaml storyboard