InertiaProcessor2D.IsRunning Propriété

Définition

Obtient si l’inertie est actuellement en cours.

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

Valeur de propriété

Valeur booléenne indiquant si l’inertie est en cours.

Exemples

Dans l’exemple suivant, un gestionnaire d’événements pour l’événement vérifie si le ManipulationProcessor2D.Started traitement de l’inertie est en cours d’exécution et, le cas échéant, l’arrête en appelant la Completed méthode.

#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

S’applique à