共用方式為


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

適用於