开发者

Silverlight XAML arcsegment size animation

I'm using Silverlight 4, trying to animate an arcsegment's size property. The only type of animation I've had success with is ObjectAnimationUsingKeyFrames. This turns out to be a pain, so I've tried doing a double animation on the height and width of the size property but that doesn't work.

   <Path Stroke="Red" StrokeThickness="20">
        <Path.Data>
            <PathGeometry>
                <PathFigure StartPoint="0,200">
                    <ArcSegment x:Name="ArcSeg1" Size="100,100" RotationAngle="0" IsLargeArc="True" 
                        SweepDirection="Clockwise" Point="200,200" />
                </PathFigure>
            </PathGeometry>
        </Path.Data>
    </Path>

    <DoubleAnimation
        Storyb开发者_开发百科oard.TargetName="ArcSeg1"
         Storyboard.TargetProperty="Size.Width"
         From="100"
         To="50"
         Duration="00:00:05"
     />

But this only results in the following error:

Cannot resolve TargetProperty Size.Width on specified object.

Thanks in advance.


Although Size is a DependencyProperty (and hence u can animate it), Size.Width is not. (Width is just a regular property)

Try and animate the Path itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜