Compartir por


InertiaRotationBehavior Clase

Definición

Controla la ralentización de una manipulación de rotación durante la inercia.

public ref class InertiaRotationBehavior
public class InertiaRotationBehavior
type InertiaRotationBehavior = class
Public Class InertiaRotationBehavior
Herencia
InertiaRotationBehavior

Ejemplos

En el ejemplo siguiente se muestra el ManipulationInertiaStarting controlador de eventos y se establece la desaceleración deseada para la traducción, expansión y rotación que se usa durante la inercia. Este ejemplo forma parte de un ejemplo más grande en Walkthrough: Creating Your First Touch Application.

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

Comentarios

La InertiaRotationBehavior clase especifica cómo se comporta una manipulación de rotación cuando es inercia. Use la RotationBehavior propiedad en el ManipulationInertiaStarting evento para hacer lo siguiente:

  • Especifique la velocidad inicial de la inercia cuando comienza estableciendo la InitialVelocity propiedad .

  • Especifique la rotación deseada de la manipulación cuando finalice la inercia estableciendo la DesiredRotation propiedad .

  • Especifique la desaceleración deseada de la inercia estableciendo la DesiredDeceleration propiedad .

Establezca o DesiredRotationDesiredDeceleration, pero no ambos. Al establecer una de estas propiedades, la otra propiedad se cambia a Double.NaN si tiene un valor.

Para obtener más información sobre las manipulaciones, consulte Introducción a la entrada. Para obtener un ejemplo de una aplicación que responde a manipulaciones, consulte Tutorial: Creación de la aplicación First Touch.

Constructores

Nombre Description
InertiaRotationBehavior()

Inicializa una nueva instancia de la clase InertiaRotationBehavior.

Propiedades

Nombre Description
DesiredDeceleration

Obtiene o establece la velocidad a la que la rotación se ralentiza en grados por milisegundos cuadrados.

DesiredRotation

Obtiene o establece el giro, en grados, al final del movimiento inercial.

InitialVelocity

Obtiene o establece la velocidad inicial de la rotación al principio de la fase de inercia.

Métodos

Nombre Description
Equals(Object)

Determina si el objeto especificado es igual al objeto actual.

(Heredado de Object)
GetHashCode()

Actúa como función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Objectactual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Se aplica a