well I've created something in Expression Blend and both the XAML and javascript work fine, but then I add it dynamically using .net and I get an error with saying basically that it can't begin() the storyboard. Here is what the dynamic XAML looks like:
Code:
StringBuilder sb = new StringBuilder();
sb.Append(@"<Storyboard x:Name=""SB" + xamlObjectName + @"_Enter"">
<DoubleAnimationUsingKeyFrames BeginTime=""00:00:00"" Storyboard.TargetName=""" + xamlObjectName + @"_SubRect"" Storyboard.TargetProperty=""(FrameworkElement.Height)"">
<SplineDoubleKeyFrame KeyTime=""00:00:00"" Value=""22""/>
<SplineDoubleKeyFrame KeyTime=""00:00:00.2000000"" Value=""30""/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime=""00:00:00"" Storyboard.TargetName=""" + xamlObjectName + @"_SubRect"" Storyboard.TargetProperty=""(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"">
<SplineDoubleKeyFrame KeyTime=""00:00:00"" Value=""0""/>
<SplineDoubleKeyFrame KeyTime=""00:00:00.2000000"" Value=""-8""/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Name=""SB" + xamlObjectName + @"_Leave"">
<DoubleAnimationUsingKeyFrames BeginTime=""00:00:00"" Storyboard.TargetName=""" + xamlObjectName + @"_SubRect"" Storyboard.TargetProperty=""(FrameworkElement.Height)"">
<SplineDoubleKeyFrame KeyTime=""00:00:00"" Value=""30""/>
<SplineDoubleKeyFrame KeyTime=""00:00:00.2000000"" Value=""22""/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime=""00:00:00"" Storyboard.TargetName=""" + xamlObjectName + @"_SubRect"" Storyboard.TargetProperty=""(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"">
<SplineDoubleKeyFrame KeyTime=""00:00:00"" Value=""-8""/>
<SplineDoubleKeyFrame KeyTime=""00:00:00.2000000"" Value=""0""/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>");
Each storyboard has 2 DoubleAnimationUsingKeyFrames, it seems that if I remove 1 DoubleAnimationUsingKeyFrames from each storyboard everything works fine. Yet the same thing works fine when I do it with Blend. Anyone have any idea why this would be happening.
|