InertiaProcessor2D.IsRunning 属性

定义

获取当前是否在发生惯性。

public:
 property bool IsRunning { bool get(); };
public bool IsRunning { get; }
member this.IsRunning : bool
Public ReadOnly Property IsRunning As Boolean

属性值

一个布尔值,该值指示当前是否在发生惯性。

示例

在以下示例中,事件的 ManipulationProcessor2D.Started 事件处理程序检查惯性处理是否正在运行,如果是,则通过调用 Completed 方法停止该处理。

#region OnManipulationStarted
private void OnManipulationStarted(object sender, Manipulation2DStartedEventArgs e)
{
    if (inertiaProcessor.IsRunning)
    {
        inertiaProcessor.Complete(Timestamp);
    }
}
#endregion
#region Timestamp
private long Timestamp
{
    get
    {
        // Get timestamp in 100-nanosecond units.
        double nanosecondsPerTick = 1000000000.0 / System.Diagnostics.Stopwatch.Frequency;
        return (long)(System.Diagnostics.Stopwatch.GetTimestamp() / nanosecondsPerTick / 100.0);
    }
}
#endregion

适用于