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.

class CAnimationVariableChangeHandler : public CUIAnimationVariableChangeHandlerBase<CAnimationVariableChangeHandler>;  

Public Constructors

NameDescription
CAnimationVariableChangeHandler::CAnimationVariableChangeHandlerConstructs a CAnimationVariableChangeHandler object.

Public Methods

NameDescription
CAnimationVariableChangeHandler::CreateInstanceCreates an instance of CAnimationVariableChangeHandler object.
CAnimationVariableChangeHandler::OnValueChangedCalled when a value of an animation variable has changed. (Overrides CUIAnimationVariableChangeHandlerBase::OnValueChanged.)
CAnimationVariableChangeHandler::SetAnimationControllerStores a pointer to animation controller to route events.

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

CUIAnimationCallbackBase

CUIAnimationVariableChangeHandlerBase

CAnimationVariableChangeHandler

Header: afxanimationcontroller.h

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.

Stores a pointer to animation controller to route events.

void SetAnimationController(CAnimationController* pAnimationController);

Parameters

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

Classes

Show: