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");
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);
Error: KeyFramesProperty – Cannot fetch the value of field ‘KeyFramesProperty’ because information about the containing class is unavailable.
Ok, how about this…