日期:2014-05-17  浏览次数:20723 次

WPF,这个动画为什么报错呢?

<Window.Resources>
        <Storyboard x:Key="aa">
            <DoubleAnimation Storyboard.TargetProperty="Ellipse.Width" From="0" To="20" Duration="0:0:2"/>
            <DoubleAnimation Storyboard.TargetProperty="Ellipse.Height" From="0" To="20" Duration="0:0:2"/>
            <DoubleAnimation Storyboard.TargetProperty="Ellipse.StrokeThickness" From="2" To="8" Duration="0:0:2"/>
            <DoubleAnimation Storyboard.TargetProperty="Ellipse.Opacity" From="1" To="0" Duration="0:0:2"/>
        </Storyboard>
    </Window.Resources>
    <Grid HorizontalAlignment="Left" Height="619" VerticalAlignment="Top" Width="1168.25">
        <Ellipse Fill="White" HorizontalAlignment="Left" Height="21.667" Margin="197,39,0,0" VerticalAlignment="Top" Width="21.667" Stroke="#FFF9EFEF">
            <Ellipse.Triggers>
                <EventTrigger RoutedEvent="Ellipse.Loaded">
                    <EventTrigger.Actions>
                        <BeginStoryboard Storyboard="{StaticResource aa}"/>
                    </EventTrigger.Actions>
                </EventTrigger>
            </Ellipse.Triggers>
        </Ellipse>
    </Grid>


为什么报错呢?

------解决方案--------------------
Storyboard.TargetProperty="Ellipse.Width"
改成
Storyboard.TargetProperty="Width"

其他几个,做同样的修改。