MatrixAnimationUsingPath.IsAdditive Eigenschap
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee wordt een waarde opgehaald of ingesteld die aangeeft of de huidige waarde van de doeleigenschap moet worden toegevoegd aan de beginwaarde van deze animatie.
public:
property bool IsAdditive { bool get(); void set(bool value); };
public bool IsAdditive { get; set; }
member this.IsAdditive : bool with get, set
Public Property IsAdditive As Boolean
Waarde van eigenschap
true als de huidige waarde van de doeleigenschap moet worden toegevoegd aan de beginwaarde van deze animatie; anders, false. De standaardwaarde is false.
Voorbeelden
In het volgende voorbeeld worden twee vergelijkbare MatrixAnimationUsingPath animaties gebruikt om dezelfde rechthoek te animeren. De eigenschap van IsAdditive de eerste animatie is ingesteld op false, zodat deze altijd de rechthoek van (0,0), de beginwaarde van de animatie aangeeft. De tweede animatie heeft dezelfde doelwaarden (hun PathGeometry instellingen zijn identiek), maar de IsAdditive eigenschap is ingesteld op true; hierdoor wordt de rechthoek van elke positie weergegeven waarop de animatie zich bevindt.
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="PresentationOptions">
<StackPanel>
<!-- The Rectangle that is animated across the screen by animating
the MatrixTransform applied to the button. -->
<Rectangle
Width="50" Height="20"
Fill="Blue"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Rectangle.RenderTransform>
<MatrixTransform x:Name="myMatrixTransform">
<MatrixTransform.Matrix >
<Matrix OffsetX="10" OffsetY="100"/>
</MatrixTransform.Matrix>
</MatrixTransform>
</Rectangle.RenderTransform>
</Rectangle>
<StackPanel Margin="0,200,0,0" Orientation="Horizontal">
<Button Content="Animate with IsAdditive set to False"
HorizontalAlignment="Left" Padding="5">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard>
<!-- This animation always moves the
rectangle back to (0,0). -->
<MatrixAnimationUsingPath
Storyboard.TargetName="myMatrixTransform"
Storyboard.TargetProperty="Matrix"
Duration="0:0:2"
DoesRotateWithTangent="True"
IsAdditive="False">
<MatrixAnimationUsingPath.PathGeometry>
<PathGeometry
Figures="M 0,0 C 35,0 135,0 160,100 180,190 285,200 310,100" />
</MatrixAnimationUsingPath.PathGeometry>
</MatrixAnimationUsingPath>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
<Button Content="Animate with IsAdditive set to True"
HorizontalAlignment="Left"
Padding="5">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
<Storyboard>
<!-- This animation moves the rectangle from
its current position. -->
<MatrixAnimationUsingPath
Storyboard.TargetName="myMatrixTransform"
Storyboard.TargetProperty="Matrix"
Duration="0:0:2"
DoesRotateWithTangent="True"
IsAdditive="True">
<MatrixAnimationUsingPath.PathGeometry>
<PathGeometry
Figures="M 0,0 C 35,0 135,0 160,100 180,190 285,200 310,100" />
</MatrixAnimationUsingPath.PathGeometry>
</MatrixAnimationUsingPath>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
</StackPanel>
</StackPanel>
</Page>
Opmerkingen
Informatie over afhankelijkheidseigenschappen
| Item | Waarde |
|---|---|
| Id-veld | IsAdditiveProperty |
Eigenschappen van metagegevens ingesteld op true |
Geen |
Note
Deze afhankelijkheidseigenschap is ongebruikelijk omdat het id-veld voor deze eigenschap afkomstig is van AnimationTimeline en wordt gedeeld door verschillende afgeleide klassen.