Share via


IXRTimeline::GetRepeatBehavior (Compact 2013)

3/28/2014

This method retrieves the repeating behavior of this timeline.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetRepeatBehavior(
    XRRepeatBehavior* pRepeatBehavior
) = 0;

Parameters

  • pRepeatBehavior
    [out] Pointer to an XRRepeatBehavior structure that describes the repeating behavior of this timeline.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

If an iteration count value is specified in XRRepeatBehavior.IterationCount and IXRTimeline::GetAutoReverse retrieves a value of true, a single repetition consists of one forward iteration and one backward iteration. A timeline set to automatically reverse and with an XRRepeatBehavior.IterationCount set to 2 would play forward, then play backward, then play forward again, and then backward again.

Instead of specifying the number of times that a timeline plays, you can also specify the total length of time that you want the timeline to play. For a timeline to repeat itself, the XRRepeatBehavior.RepeatDuration value should be greater than the value retrieved by IXRTimeline::GetDuration.

For example, a timeline for which the IXRTimeline::GetDuration method retrieves 2 seconds and that has an XRRepeatBehavior.RepeatDuration value set to 4 seconds will play two times. If the XRRepeatBehavior.RepeatDuration value is less than the duration of the timeline, the active period of the timeline is reduced.

This method applies to both specific animations and to the parent storyboard. We generally recommend that you apply repeat behavior to the storyboard, because if you apply repeat behavior to the animation the default value of the parent storyboard will prevent any child repeat behaviors from being applied. However, you can specify repeat behaviors on child animations if they are intended to run fewer seconds or fewer iterations than the parent storyboard.

.NET Framework Equivalent

System.Windows.Media.Animation.Timeline.RepeatBehavior

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRTimeline
IXRTimeline::SetRepeatBehavior