Share via


CompositionAnimation.SetReferenceParameter(String, CompositionObject) 메서드

정의

ExpressionAnimation 또는 식키 프레임에 사용할 Composition 개체에 대한 참조를 설정합니다.

public:
 virtual void SetReferenceParameter(Platform::String ^ key, CompositionObject ^ compositionObject) = SetReferenceParameter;
void SetReferenceParameter(winrt::hstring const& key, CompositionObject const& compositionObject);
public void SetReferenceParameter(string key, CompositionObject compositionObject);
function setReferenceParameter(key, compositionObject)
Public Sub SetReferenceParameter (key As String, compositionObject As CompositionObject)

매개 변수

key
String

Platform::String

winrt::hstring

설정할 매개 변수의 이름입니다. 이름은 ExpressionAnimation에서 매개 변수를 참조하는 데 사용할 수 있습니다.

compositionObject
CompositionObject

CompositionObject 값입니다.

예제

아래 샘플에서는 ExpressionAnimation 을 사용하여 배경과 전경 시각적 개체 간에 시차 효과를 만드는 방법을 간략하게 설명합니다. 이 유형의 애니메이션은 Windows 시작 화면 및 Windows Phone Hub UI에서 볼 수 있습니다.

void CreateParallaxExpression(Visual foreground, Visual background) 
{ 
    var animation = _compositor.CreateExpressionAnimation(); 

    animation.Expression = "foreground.Offset * (foreground.Size / background.Size)"; 

    animation.SetReferenceParameter("foreground", foreground); 
    animation.SetReferenceParameter("background", background); 

    background.StartAnimation("Offset", animation); 
} 

설명

CompositionObject에 대한 참조를 설정하여 ExpressionAnimation은 해당 CompositionObject의 애니메이션 가능 속성을 참조할 수 있습니다. Compositor에서 CompositionObject의 현재 속성 값은 식 값을 계산할 때 사용됩니다. 자세한 내용은 ExpressionAnimation 의 설명 섹션을 참조하세요.

적용 대상