Clock.CurrentTime 属性

定义

在此时钟的当前迭代中获取它的当前时间。Gets this clock's current time within its current iteration.

public:
 property Nullable<TimeSpan> CurrentTime { Nullable<TimeSpan> get(); };
public TimeSpan? CurrentTime { get; }
member this.CurrentTime : Nullable<TimeSpan>
Public ReadOnly Property CurrentTime As Nullable(Of TimeSpan)

属性值

如果此时钟为 null,则为 Stopped;否则为此时钟的当前时间。null if this clock is Stopped; otherwise, the current time of this clock.

注解

使用时间线作为计时器Using a Timeline as a Timer

仅当存在与其相关联的事件处理程序时,或(在 AnimationClock 对象的情况下)与属性关联时,时间线的时钟才会进行。A timeline's clock will only progress when there's an event handler associated with it or (in the case of an AnimationClock object) it is associated with a property. 出于此原因(以及其他),不建议将 Timeline 用作计时器。For this reason (and others), it's not recommended that you use a Timeline as a timer.

适用于

另请参阅