tags:

views:

59

answers:

1

I have the following Storyboard:

'LayoutMargin' is a dependency property defined in the ancestor Window. This is the problem I'm having: The first time I run the animation it doesn't work - as if the LayoutMargin.Value isn't set. However, the second time I run the animation, and all subsequent times I run the animation, it work just fine. At first I suspected the LayoutMargin.Value was not set prior to the first animation, but it is set.

Does anyone have any ideas about why this is happening?

A: 

Whoops, this is my Storyboard:

<Storyboard x:Key="LayoutStoryboard">
    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="H3" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                    <SplineThicknessKeyFrame KeyTime="00:00:00" Value="5"/>
                    <SplineThicknessKeyFrame KeySpline="0.25,0,0.5,1" KeyTime="00:00:01.2000000" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=LayoutMargin.Value}"/>
                </ThicknessAnimationUsingKeyFrames>
    <Storyboard/>