Ошибка BAML при анимации - PullRequest
0 голосов
/ 02 апреля 2011

У меня есть следующий код в проекте WPF 4, связанный с imagebox. У меня есть четыре других подобных случая, которые работают отлично. Почему эта ошибка выдает ту расплывчатую ошибку "BAML", которую мы все ненавидим (она указывает на анимацию)? К вашему сведению, я использую VB.net в коде позади.

<Image Height="121" HorizontalAlignment="Left" Margin="139,83,0,0" Name="Spinefish" Stretch="Fill" VerticalAlignment="Top" Width="323" Source="/VBP-WORD4WORD;component/Images/IMG-SPINEFISH1.png">
            <Image.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" />
                    <TranslateTransform X="0" />
                </TransformGroup>
            </Image.RenderTransform>
            <Image.Triggers>
                <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                    <BeginStoryboard>
                        <BeginStoryboard.Storyboard>
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames Duration="0:0:60" RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.Children[1].X">
                                    <LinearDoubleKeyFrame KeyTime="0:0:0" Value="-1000" />
                                    <LinearDoubleKeyFrame KeyTime="0:0:25" Value="-1000" />
                                    <LinearDoubleKeyFrame KeyTime="0:0:30" Value="1000" />
                                    <LinearDoubleKeyFrame KeyTime="0:0:55" Value="1000" />
                                    <LinearDoubleKeyFrame KeyTime="0:0:60" Value="-1000" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Duration="0:0:60" RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX">
                                    <LinearDoubleKeyFrame KeyTime="0:0:29.9" Value="1" />
                                    <LinearDoubleKeyFrame KeyTime="0:0:30" Value="-1" />
                                    <LinearDoubleKeyFrame KeyTime="0:0:59.9" Value="-1" />
                                    <LinearDoubleKeyFrame KeyTime="0:0:60" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard.Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Image.Triggers>
        </Image>

1 Ответ

0 голосов
/ 02 апреля 2011

KeyTime="0:0:60" и Duration="0:0:60" не существуют, диапазон секунд от 0 до 59, измените их на 0:1:0.

...