Timeline.RepeatBehavior 屬性

定義

取得或設定這個時刻表的重複行為。Gets or sets the repeating behavior of this timeline.

public:
 property System::Windows::Media::Animation::RepeatBehavior RepeatBehavior { System::Windows::Media::Animation::RepeatBehavior get(); void set(System::Windows::Media::Animation::RepeatBehavior value); };
public System.Windows.Media.Animation.RepeatBehavior RepeatBehavior { get; set; }
member this.RepeatBehavior : System.Windows.Media.Animation.RepeatBehavior with get, set
Public Property RepeatBehavior As RepeatBehavior

屬性值

指定時刻表應播放次數的反覆 Count、指定這個時刻表之作用期總長度的 TimeSpan 值,或是指定時刻表應無限次重複的特殊值 ForeverAn iteration Count that specifies the number of times the timeline should play, a TimeSpan value that specifies the total the length of this timeline's active period, or the special value Forever, which specifies that the timeline should repeat indefinitely. 預設值是RepeatBehavior Count , 其為1, 表示時間軸播放一次。The default value is a RepeatBehavior with a Count of 1, which indicates that the timeline plays once.

備註

如果指定了Count反復專案, 而且時間軸AutoReverse的屬性設定為true, 則單一重複會包含一個向前反復專案和一個回溯反復專案。If an iteration Count is specified and the timeline's AutoReverse property is set to true, a single repetition consists of one forward iteration and one backward iteration. AutoReverse屬性設定為 true 的時間軸會向前Count播放2次, 然後向後再向前轉送, 然後再向後回溯。A timeline with an AutoReverse property set to true an iteration Count of 2 would play forwards, then backwards, then forwards again, and then backwards again.

您也可以指定要播放時間軸的總時間長度, 而不是指定時間軸播放的次數。Instead of specifying the number of times a timeline plays, you can also specify the total length of time you want the timeline to play. 若要讓時程表重複, 此RepeatBehavior.Duration值應該大於時間軸的。 DurationFor a timeline to repeat, this RepeatBehavior.Duration value should be greater than the timeline's Duration. 例如, 如果時間軸Duration的為2秒RepeatBehavior.Duration , 且為4秒, 則會播放兩次。For example, a timeline with a Duration of 2 seconds and a RepeatBehavior.Duration of 4 seconds will play twice. 如果小於時間軸的Duration, 則會縮短時間軸的現用期間。 RepeatBehavior.DurationIf the RepeatBehavior.Duration is less than the timeline's Duration, the timeline's active period is cut short.

如需重複時間軸的詳細資訊, 請參閱動畫總覽For more information about repeating timelines, see Animation Overview.

相依性屬性資訊Dependency Property Information

識別碼欄位Identifier field RepeatBehaviorProperty
中繼資料屬性設定為trueMetadata properties set to true None

適用於

另請參閱