2011-05-19 69 views
0

我正在使用Silverlight 4,試圖爲arcsegment的大小屬性設置動畫效果。我唯一成功的動畫類型是ObjectAnimationUsingKeyFrames。事實證明這是一種痛苦,所以我試着在size屬性的高度和寬度上做一個雙動畫,但是這不起作用。Silverlight XAML圓弧段大小動畫

<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 
     Storyboard.TargetName="ArcSeg1" 
     Storyboard.TargetProperty="Size.Width" 
     From="100" 
     To="50" 
     Duration="00:00:05" 
    /> 

但是,這不僅導致了以下錯誤:

不能指定對象上解決TargetProperty Size.Width。

在此先感謝。

回答

0

儘管Size是一個DependencyProperty(因此你可以對它進行動畫處理),但Size.Width不是。 (寬度只是一個固定的屬性)

嘗試和動畫路徑本身。