0

我有以下代码可以永远为椭圆的宽度设置动画,直到窗口关闭。但是,它会抛出XamlParseExceptionError. 有人能指出我在哪里犯了错误吗?

`

        </TextBlock>

        <TextBlock x:Uid="ProductName" Localization.Attributes="$Content(Readable Unmodifiable)">
            <TextBlock.ToolTip>
                <TextBlock x:Uid="ProductNameTip" Localization.Attributes="$Content(ToolTip Readable Modifiable)">
                    A photo editor that will make everyone look beautiful
                </TextBlock>
            </TextBlock.ToolTip>
            Amazing Photo Editor
        </TextBlock>

        <Ellipse Name="Circle" 
                 Width="100" 
                 Height="100" 
                 Fill="Red">
            <Ellipse.Triggers>
                <EventTrigger RoutedEvent="Ellipse.Loaded">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.Target="Circle" 
                                             Storyboard.TargetProperty="Width" 
                                             From="1" 
                                             To="100" 
                                             Duration="0:0:5" 
                                             AutoReverse="True" 
                                             RepeatBehavior="Forever">

                            </DoubleAnimation>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Ellipse.Triggers>
        </Ellipse>
    </StackPanel>
</Grid>

`

4

1 回答 1

1

使用Storyboard.TargetName Attached Property而不是Storyboard.Target.

<DoubleAnimation Storyboard.TargetName="Circle"
于 2013-01-19T18:44:11.610 回答