Aracılığıyla paylaş


MatrixAnimationUsingPath.IsAngleCumulative Özellik

Tanım

Animasyonlu matrisin döndürme açısının yinelemeler üzerinde birikip birikmeyeceğini belirten bir değer alır veya ayarlar.

public:
 property bool IsAngleCumulative { bool get(); void set(bool value); };
public bool IsAngleCumulative { get; set; }
member this.IsAngleCumulative : bool with get, set
Public Property IsAngleCumulative As Boolean

Özellik Değeri

true animasyonun döndürme açısı tekrarlar üzerinde birikmeliyse; aksi takdirde , false. Varsayılan değer: false.

Örnekler

Aşağıdaki örnek, aynı dikdörtgene animasyon eklemek için iki benzer MatrixAnimationUsingPath animasyon kullanır. Her iki animasyon da aynı PathGeometry ayara sahiptir ve bu da dikdörtgenin ekran boyunca sağa doğru ilerledikçe dönmesine neden olur ve her iki animasyon da dört kez yinelenmek üzere ayarlanır. İlk animasyon özelliği IsAngleCumulative olarak falseayarlanır, bu nedenle animasyon yinelendiğinde dikdörtgen özgün açısına geri atlar. İkinci animasyon özelliği IsAngleCumulative olarak ayarlanır true; sonuç olarak, animasyon tekrarlandığında özgün değerine geri atlamak yerine dikdörtgen açısı artacak şekilde görünür.

<Page 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  <StackPanel Margin="50">
      
    <!-- The Rectangle that is animated across the screen by animating
         the MatrixTransform applied to the button. -->
    <Rectangle 
      Width="75" Height="25"
      HorizontalAlignment="Left"
      VerticalAlignment="Top"
      Stroke="Black" StrokeThickness="1">
      <Rectangle.RenderTransform>
        <MatrixTransform x:Name="myMatrixTransform">
          <MatrixTransform.Matrix >
            <Matrix OffsetX="10" OffsetY="100"/>
          </MatrixTransform.Matrix>
        </MatrixTransform>
      </Rectangle.RenderTransform>
      <Rectangle.Fill>
        <LinearGradientBrush>
          <GradientStop Color="Lime" Offset="0.0" />
          <GradientStop Color="Gray" Offset="1.0" />
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <!-- Shows the animation path. -->
    <Path
      Stroke="Black" StrokeThickness="5"
      Data="M 0,0 A 50,50 0 1 0 100,0" />
    
    <StackPanel Margin="0,200,0,0" Orientation="Horizontal">
    <Button Content="Animate with IsAngleCumulative set to False"
      HorizontalAlignment="Left" Padding="5">
      <Button.Triggers>
        <EventTrigger RoutedEvent="Button.Click">
          <BeginStoryboard>
            <Storyboard>

              <!-- The angle generated by this animation does not
                   accumulate over repetitions. As a result, 
                   the rectangle appears to jump back to its 
                   starting angle when the animation repeats.  -->
              <MatrixAnimationUsingPath
                Storyboard.TargetName="myMatrixTransform"
                Storyboard.TargetProperty="Matrix"
                Duration="0:0:2" 
                RepeatBehavior="4x" 
                IsOffsetCumulative="True" 
                IsAngleCumulative="False"
                DoesRotateWithTangent="True">
                <MatrixAnimationUsingPath.PathGeometry>
                  <PathGeometry Figures="M 0,0 A 50,50 0 1 0 100,0" />
                </MatrixAnimationUsingPath.PathGeometry>
              </MatrixAnimationUsingPath>
            </Storyboard>
          </BeginStoryboard>
        </EventTrigger>
      </Button.Triggers>   
    </Button>
    
     <Button Content="Animate with IsAngleCumulative set to True"
      HorizontalAlignment="Left" 
      Padding="5">
      <Button.Triggers>
        <EventTrigger RoutedEvent="Button.Click">
          <BeginStoryboard>
            <Storyboard>
            
              <!-- The angle generated by this animation accumulates
                   over repetitions. As a result, the rectangle's
                   rotation appears seamless.  -->
              <MatrixAnimationUsingPath
                Storyboard.TargetName="myMatrixTransform"
                Storyboard.TargetProperty="Matrix"
                Duration="0:0:2" 
                RepeatBehavior="4x" 
                IsOffsetCumulative="True" 
                IsAngleCumulative="True"
                DoesRotateWithTangent="True">
                <MatrixAnimationUsingPath.PathGeometry>
                  <PathGeometry Figures="M 0,0 A 50,50 0 1 0 100,0" />
                </MatrixAnimationUsingPath.PathGeometry>
              </MatrixAnimationUsingPath>
            </Storyboard>
          </BeginStoryboard>
        </EventTrigger>
      </Button.Triggers>   
    </Button>   
    </StackPanel>
    
    
  </StackPanel>
</Page>

Açıklamalar

Bu özellik olarak trueayarlanırsa animasyon matrisinin döndürme açısı animasyon yinelenirken birikecektir. Yolunuz küçük bir yaysa, kümülatif bir açı döndürmeyi yeniden başlatmak yerine nesnenizin her yinelemeyle sürekli dönmesine neden olur. ile birleştirildiğinde IsOffsetCumulativetrue, nesneniz geri dönerken (belirttiğiniz yola bağlı olarak) yuvarlanıyor gibi görünebilir. İlgili bilgiler için bkz IsOffsetCumulative. .

Bu özelliğin ayarlanması, ise DoesRotateWithTangentfalsehiçbir etkisi olmaz.

Bu özellik, animasyon ayarı nedeniyle animasyon yinelendiğinde animasyon matrisinin açısının RepeatBehavior birikip birikmeyeceğini belirler; animasyon yeniden başlatıldığında uzaklık birikmesine neden olmaz. Önceki animasyon değerlerinden bir animasyon oluşturma hakkında bilgi için bkz IsAdditive. .

Bağımlılık Özelliği Bilgileri

Öğe Değer
Tanımlayıcı alanı IsAngleCumulativeProperty
Meta veri özellikleri olarak ayarlandı true Hiçbiri

Şunlara uygulanır

Ayrıca bkz.