2010-10-27 4 views

Répondre

1

ne sais pas si cela fait la dure ou non, mais cela fonctionne ...

<Canvas> 
    <Rectangle Height="30" Width="30" Fill="Blue"> 
     <Rectangle.RenderTransform> 
      <MatrixTransform x:Name="elementMatrixTransform"> 
       <MatrixTransform.Matrix > 
        <Matrix /> 
       </MatrixTransform.Matrix> 
      </MatrixTransform> 
     </Rectangle.RenderTransform> 
     <Rectangle.Triggers> 
      <EventTrigger RoutedEvent="Rectangle.Loaded"> 
       <BeginStoryboard> 
        <Storyboard> 
         <MatrixAnimationUsingPath 
          Storyboard.TargetName="elementMatrixTransform" 
          Storyboard.TargetProperty="Matrix" 
          Duration="0:0:10" 
          RepeatBehavior="Forever"> 
          <MatrixAnimationUsingPath.PathGeometry> 
           <PathGeometry> 
            <PathFigure StartPoint="0,50"> 
             <ArcSegment Point="50,0" Size="50,50" SweepDirection="Clockwise"></ArcSegment> 
             <ArcSegment Point="100,50" Size="50,50" SweepDirection="Clockwise"></ArcSegment> 
             <ArcSegment Point="50,100" Size="50,50" SweepDirection="Clockwise"></ArcSegment> 
             <ArcSegment Point="0,50" Size="50,50" SweepDirection="Clockwise"></ArcSegment> 
            </PathFigure> 
           </PathGeometry> 
          </MatrixAnimationUsingPath.PathGeometry> 
         </MatrixAnimationUsingPath> 

        </Storyboard> 
       </BeginStoryboard> 
      </EventTrigger> 
     </Rectangle.Triggers> 
    </Rectangle> 
</Canvas> 
Questions connexes