다음을 통해 공유


ConnectedAnimation.SetAnimationComponent 메서드

정의

연결된 애니메이션의 특정 부분의 동작을 변경하도록 사용자 지정 CompositionAnimation 을 설정합니다.

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)

매개 변수

component
ConnectedAnimationComponent

변경할 연결된 애니메이션의 부분입니다.

animation
ICompositionAnimationBase

기본 애니메이션 대신 사용할 애니메이션입니다.

설명

애니메이션을 만들 때 컴퍼지션 식 문자열 "StartingValue" 및 "FinalValue"를 사용하여 시스템의 시작 및 끝 값을 나타냅니다. 다음은 그 예입니다.

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

컴퍼지션 식을 사용하는 방법에 대한 자세한 내용은 식 키 프레임 을 참조하세요.

적용 대상