IUIAnimationStoryboard2::Schedule method (uianimation.h)

Directs the storyboard to schedule itself for play.

Syntax

HRESULT Schedule(
  [in]            UI_ANIMATION_SECONDS           timeNow,
  [out, optional] UI_ANIMATION_SCHEDULING_RESULT *schedulingResult
);

Parameters

[in] timeNow

The current time.

[out, optional] schedulingResult

The result of the scheduling request. You can omit this parameter from calls to this method.

Return value

Returns S_OK if successful; otherwise an HRESULT error code. See Windows Animation Error Codes for a list of error codes.

Remarks

This method directs a storyboard to try to add itself to the schedule of playing storyboards, using these rules:

  • If there are no playing storyboards animating any of the same animation variables, the attempt succeeds and the storyboard starts playing immediately.
  • If the storyboard has priority to cancel, trim, conclude, or compress conflicting storyboards, the attempt to schedule succeeds and the storyboard starts playing as soon as possible.
  • If the storyboard does not have priority, the attempt fails and the schedulingResult parameter is set to UI_ANIMATION_SCHEDULING_INSUFFICIENT_PRIORITY.
If this method is called from a handler for OnStoryboardStatusChanged events, the schedulingResult parameter is set to UI_ANIMATION_SCHEDULING_DEFERRED. The only way to determine whether the storyboard is successfully scheduled is to set a storyboard event handler and check whether the storyboard's status ever becomes UI_ANIMATION_SCHEDULING_INSUFFICIENT_PRIORITY.

It is possible to reuse a storyboard by calling Schedule again after its status has reached UI_ANIMATION_STORYBOARD_READY. An attempt to schedule a storyboard when it is in any state other than UI_ANIMATION_STORYBOARD_BUILDING or UI_ANIMATION_STORYBOARD_READY fails, and schedulingResult is set to UI_ANIMATION_SCHEDULING_ALREADY_SCHEDULED.

Requirements

Requirement Value
Minimum supported client Windows 8, Windows 7 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server None supported
Target Platform Windows
Header uianimation.h
DLL UIAnimation.dll

See also

IUIAnimationStoryboard2

IUIAnimationStoryboard2::Abandon

IUIAnimationStoryboard2::Conclude

IUIAnimationStoryboard2::Finish

IUIAnimationStoryboard2::GetStatus

IUIAnimationTimer::GetTime

UI_ANIMATION_SCHEDULING_RESULT

UI_ANIMATION_STORYBOARD_STATUS