Share via


ConnectedAnimation.SetAnimationComponent Methode

Definition

Legt eine benutzerdefinierte CompositionAnimation fest, um die Bewegung eines bestimmten Teils der verbundenen Animation zu ändern.

public:
 virtual void SetAnimationComponent(ConnectedAnimationComponent component, ICompositionAnimationBase ^ animation) = SetAnimationComponent;
void SetAnimationComponent(ConnectedAnimationComponent const& component, ICompositionAnimationBase const& animation);
public void SetAnimationComponent(ConnectedAnimationComponent component, ICompositionAnimationBase animation);
function setAnimationComponent(component, animation)
Public Sub SetAnimationComponent (component As ConnectedAnimationComponent, animation As ICompositionAnimationBase)

Parameter

component
ConnectedAnimationComponent

Der Teil der verbundenen Animation, der geändert werden soll.

animation
ICompositionAnimationBase

Die Animation, die anstelle der Standardanimation verwendet werden soll.

Windows-Anforderungen

Gerätefamilie
Windows 10 Creators Update (eingeführt in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (eingeführt in v4.0)

Hinweise

Verwenden Sie beim Erstellen der Animation die Kompositionsausdruckzeichenfolgen "StartingValue" und "FinalValue", um die Start- und Endwerte aus dem System darzustellen. Beispiel:

var customKeyFrameAnimation = Window.Compositor.CreateScalarKeyFrameAnimation();
customKeyFrameAnimation.Duration = ConnectedAnimationService.GetForCurrentView().DefaultDuration;
customKeyFrameAnimation.InsertExpressionKeyFrame(0.0f, "StartingValue");
customKeyFrameAnimation.InsertExpressionKeyFrame(0.5f, "FinalValue + 25");
customKeyFrameAnimation.InsertExpressionKeyFrame(1.0f, "FinalValue");

myConnectedAnimation.SetAnimationComponent(ConnectedAnimationComponent.OffsetX, customKeyFrameAnimation);

Weitere Informationen zur Verwendung von Kompositionsausdrücken finden Sie unter Expression Keyframes .

Gilt für: