CAnimationVariableChangeHandler Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CAnimationVariableChangeHandler Class.

Implements a callback, which is called by the Animation API when the value of an animation variable changes.

Syntax

class CAnimationVariableChangeHandler : public CUIAnimationVariableChangeHandlerBase<CAnimationVariableChangeHandler>;  

Members

Public Constructors

Name Description
CAnimationVariableChangeHandler::CAnimationVariableChangeHandler Constructs a CAnimationVariableChangeHandler object.

Public Methods

Name Description
CAnimationVariableChangeHandler::CreateInstance Creates an instance of CAnimationVariableChangeHandler object.
CAnimationVariableChangeHandler::OnValueChanged Called when a value of an animation variable has changed. (Overrides CUIAnimationVariableChangeHandlerBase::OnValueChanged.)
CAnimationVariableChangeHandler::SetAnimationController Stores a pointer to animation controller to route events.

Remarks

This event handler is created and passed to IUIAnimationVariable::SetVariableChangeHandler method, when you call CAnimationVariable::EnableValueChangedEvent or CAnimationBaseObject::EnableValueChangedEvent (which enables this event for all animation variables encapsulated in an animation object).

Inheritance Hierarchy

CUIAnimationCallbackBase

CUIAnimationVariableChangeHandlerBase

CAnimationVariableChangeHandler

Requirements

Header: afxanimationcontroller.h

CAnimationVariableChangeHandler::OnValueChanged

Called when a value of an animation variable has changed.

IFACEMETHOD(OnValueChanged) (
    __in IUIAnimationStoryboard* storyboard,
    __in IUIAnimationVariable* variable,
    __in DOUBLE newValue,
    __in DOUBLE previousValue);

Parameters

storyboard
The storyboard that is animating the variable.

variable
The animation variable that was updated.

newValue
The new value.

previousValue
The previous value.

Return Value

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

CAnimationVariableChangeHandler::SetAnimationController

Stores a pointer to animation controller to route events.

void SetAnimationController(CAnimationController* pAnimationController);

Parameters

pAnimationController
A pointer to animation controller, which will receive events.

See Also

Classes