InertiaRotationBehavior Classe

Définition

Contrôle la décélération d'une manipulation de rotation pendant l'inertie.

public ref class InertiaRotationBehavior
public class InertiaRotationBehavior
type InertiaRotationBehavior = class
Public Class InertiaRotationBehavior
Héritage
InertiaRotationBehavior

Exemples

L’exemple suivant montre le ManipulationInertiaStarting gestionnaire d’événements et définit la décélération souhaitée pour la traduction, l’expansion et la rotation utilisée pendant l’inertie. Cet exemple fait partie d’un exemple plus large dans Procédure pas à pas : création de votre application first touch.

void Window_InertiaStarting(object sender, ManipulationInertiaStartingEventArgs e)
{

    // Decrease the velocity of the Rectangle's movement by 
    // 10 inches per second every second.
    // (10 inches * 96 pixels per inch / 1000ms^2)
    e.TranslationBehavior.DesiredDeceleration = 10.0 * 96.0 / (1000.0 * 1000.0);

    // Decrease the velocity of the Rectangle's resizing by 
    // 0.1 inches per second every second.
    // (0.1 inches * 96 pixels per inch / (1000ms^2)
    e.ExpansionBehavior.DesiredDeceleration = 0.1 * 96 / (1000.0 * 1000.0);

    // Decrease the velocity of the Rectangle's rotation rate by 
    // 2 rotations per second every second.
    // (2 * 360 degrees / (1000ms^2)
    e.RotationBehavior.DesiredDeceleration = 720 / (1000.0 * 1000.0);

    e.Handled = true;
}
Private Sub Window_InertiaStarting(ByVal sender As Object,
                                   ByVal e As ManipulationInertiaStartingEventArgs)

    ' Decrease the velocity of the Rectangle's movement by 
    ' 10 inches per second every second.
    ' (10 inches * 96 pixels per inch / 1000ms^2)
    e.TranslationBehavior.DesiredDeceleration = 10.0 * 96.0 / (1000.0 * 1000.0)

    ' Decrease the velocity of the Rectangle's resizing by 
    ' 0.1 inches per second every second.
    ' (0.1 inches * 96 pixels per inch / (1000ms^2)
    e.ExpansionBehavior.DesiredDeceleration = 0.1 * 96 / (1000.0 * 1000.0)

    ' Decrease the velocity of the Rectangle's rotation rate by 
    ' 2 rotations per second every second.
    ' (2 * 360 degrees / (1000ms^2)
    e.RotationBehavior.DesiredDeceleration = 720 / (1000.0 * 1000.0)

    e.Handled = True
End Sub

Remarques

La InertiaRotationBehavior classe spécifie le comportement d’une manipulation de rotation lorsqu’il s’agit d’inertie. Utilisez la RotationBehavior propriété dans l’événement ManipulationInertiaStarting pour effectuer les opérations suivantes :

  • Spécifiez la vitesse initiale de l’inertie lorsqu’elle commence par définir la InitialVelocity propriété.

  • Spécifiez la rotation souhaitée de la manipulation lorsque l’inertie se termine en définissant la DesiredRotation propriété .

  • Spécifiez la décélération souhaitée de l’inertie en définissant la DesiredDeceleration propriété .

Définissez le DesiredRotation ou , DesiredDecelerationmais pas les deux. Lorsque vous définissez l’une de ces propriétés, l’autre propriété est remplacée par Double.NaN si elle a une valeur.

Pour plus d’informations sur les manipulations, consultez Vue d’ensemble des entrées. Pour obtenir un exemple d’application qui répond aux manipulations, consultez Procédure pas à pas : création de votre première application tactile.

Constructeurs

InertiaRotationBehavior()

Initialise une nouvelle instance de la classe InertiaRotationBehavior.

Propriétés

DesiredDeceleration

Obtient ou définit le taux de ralentissement de la rotation en degrés par milliseconde au carré.

DesiredRotation

Obtient ou définit la rotation, en degrés, à la fin du déplacement de l'inertie.

InitialVelocity

Obtient ou définit le taux initial de la rotation au début de la phase d'inertie.

Méthodes

Equals(Object)

Détermine si l'objet spécifié est égal à l'objet actuel.

(Hérité de Object)
GetHashCode()

Fait office de fonction de hachage par défaut.

(Hérité de Object)
GetType()

Obtient le Type de l'instance actuelle.

(Hérité de Object)
MemberwiseClone()

Crée une copie superficielle du Object actuel.

(Hérité de Object)
ToString()

Retourne une chaîne qui représente l'objet actuel.

(Hérité de Object)

S’applique à