ConnectedAnimation.SetAnimationComponent Metodo

Definizione

Imposta un oggetto CompositionAnimation personalizzato per modificare il movimento di una determinata parte dell'animazione connessa.

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)

Parametri

component
ConnectedAnimationComponent

Parte dell'animazione connessa da modificare.

animation
ICompositionAnimationBase

Animazione da usare al posto di quella predefinita.

Requisiti Windows

Famiglia di dispositivi
Windows 10 Creators Update (è stato introdotto in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (è stato introdotto in v4.0)

Commenti

Quando si crea l'animazione, usare stringhe di espressioni di composizione "StartingValue" e "FinalValue" per rappresentare i valori iniziali e finali del sistema. Ad esempio:

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);

Per altre informazioni sull'uso delle espressioni di composizione, vedere Fotogrammi chiave di espressione.

Si applica a