MatrixAnimationUsingPath.IsAngleCumulative Propriedade
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém ou define um valor que especifica se o ângulo de rotação da matriz animada deve se acumular entre repetições.
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
Valor da propriedade
true se o ângulo de rotação da animação deve se acumular em repetições; caso contrário, false. O padrão é false.
Exemplos
O exemplo a seguir usa duas animações semelhantes MatrixAnimationUsingPath para animar o mesmo retângulo. Ambas as animações têm a mesma PathGeometry configuração, o que faz com que o retângulo gire à medida que se move ao longo da tela para a direita, e ambas as animações são definidas para repetir quatro vezes. A propriedade da IsAngleCumulative primeira animação é definida como false, de modo que o retângulo salta de volta para seu ângulo original quando a animação se repete. A propriedade da IsAngleCumulative segunda animação é definida truecomo ; como resultado, o ângulo do retângulo parece aumentar quando a animação se repete, em vez de saltar de volta para seu valor original.
<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>
Comentários
Se essa propriedade estiver definida como true, o ângulo de rotação da matriz animada será acumulado à medida que a animação se repetir. Se o caminho for um arco pequeno, um ângulo cumulativo fará com que o objeto gire continuamente com cada repetição em vez de reiniciar a rotação. Quando combinado com um IsOffsetCumulative de true, seu objeto pode parecer cair enquanto ele salta (dependendo do caminho especificado). Para obter informações relacionadas, consulte IsOffsetCumulative.
Definir essa propriedade não terá nenhum efeito se DoesRotateWithTangent for false.
Essa propriedade determina se o ângulo da matriz de animação se acumula quando a animação se repete devido à sua RepeatBehavior configuração; ela não faz com que o deslocamento se acumule quando a animação é reiniciada. Para obter informações sobre como criar uma animação com base nos valores de uma animação anterior, consulte IsAdditive.
Informações da propriedade de dependência
| Campo identificador | IsAngleCumulativeProperty |
Propriedades de metadados definidas como true |
Nenhum |