RepeatBehavior Structure

Describes how a Timeline repeats its simple duration.

Namespace:  System.Windows.Media.Animation
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

[TypeConverterAttribute(typeof(RepeatBehaviorConverter))]
public struct RepeatBehavior : IFormattable
<object property="iterationCountx"/>- or -<object property="[days.]hours:minutes:seconds[.fractionalSeconds]"/>- or -<object property="[days.]hours:minutes"/>- or - <object property="days"/>- or -<object property="Forever"/>

XAML Values

Items in square brackets ([ and ]) are optional.

iterationCount

System.Double

A value greater than or equal to 0 that specifies the number of times a timeline should play. For more information, see the Count property.

days

System.Int32

A value greater than or equal to 0 that specifies the number of days for a Timeline object's active duration. For more information, see the Duration property.

hours

System.Int32

A value between 0 and 23 that specifies the number of hours for a Timeline object's active duration. For more information, see the Duration property.

minutes

System.Int32

A value between 0 and 59 that specifies the number of minutes for a Timeline object's active duration. For more information, see the Duration property.

seconds

System.Double

A value between 0 and 59 that specifies the number of seconds for a Timeline object's active duration. For more information, see the Duration property.

fractionalSeconds

System.Int32

A value consisting of 1 to 7 digits that represents fractional seconds.

The RepeatBehavior type exposes the following members.

  NameDescription
Public methodRepeatBehavior(Double)Initializes a new instance of the RepeatBehavior structure with the specified iteration count.
Public methodRepeatBehavior(TimeSpan)Initializes a new instance of the RepeatBehavior structure with the specified repeat duration.
Top

  NameDescription
Public propertyCountGets the number of times a Timeline should repeat.
Public propertyDurationGets the total length of time a Timeline should play.
Public propertyStatic memberForeverGets a RepeatBehavior that specifies an infinite number of repetitions.
Public propertyHasCountGets a value that indicates whether the repeat behavior has a specified iteration count.
Public propertyHasDurationGets a value that indicates whether the repeat behavior has a specified repeat duration.
Top

  NameDescription
Public methodEquals(Object)Indicates whether this instance is equal to the specified object. (Overrides ValueType.Equals(Object).)
Public methodEquals(RepeatBehavior)Returns a value that indicates whether this instance is equal to the specified RepeatBehavior.
Public methodStatic memberEquals(RepeatBehavior, RepeatBehavior)Indicates whether the two specified RepeatBehavior structures are equal.
Public methodGetHashCode Returns the hash code of this instance. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToString()Returns a string representation of this RepeatBehavior instance. (Overrides ValueType.ToString().)
Public methodToString(IFormatProvider)Returns a string representation of this RepeatBehavior instance with the specified format.
Top

  NameDescription
Public operatorStatic memberEqualityIndicates whether the two specified RepeatBehavior instances are equal.
Public operatorStatic memberInequalityIndicates whether the two RepeatBehavior instances are not equal.
Top

  NameDescription
Explicit interface implemetationPrivate methodIFormattable.ToStringFormats the value of the current instance using the specified format.
Top

There are three types of RepeatBehavior behaviors:

  • Iteration Count - specifies the number of times the simple duration of a Timeline plays. The default iteration count is 1.0, and means the Timeline is active for exactly one of its simple durations. A count of 0.5 specifies that the timeline is active for half of its simple duration, while a count of 2 specifies that the timeline repeats its simple duration twice. For more information, see the Count property.

  • Duration - specifies the length of the Timeline object's active duration. For example, a Timeline with a simple Duration value of 1 second and a RepeatBehavior.Duration value of 2.5 seconds will run for 2.5 iterations.

  • Forever - the Timeline repeats indefinitely.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft