InertiaRotationBehavior Classe

Definição

Controla a desaceleração de uma manipulação de rotação durante a inércia.

public ref class InertiaRotationBehavior
public class InertiaRotationBehavior
type InertiaRotationBehavior = class
Public Class InertiaRotationBehavior
Herança
InertiaRotationBehavior

Exemplos

O exemplo seguinte mostra o ManipulationInertiaStarting gestor de eventos e define a desaceleração desejada para translação, expansão e rotação que é usada durante a inércia. Este exemplo faz parte de um exemplo mais amplo em Walkthrough: Criar a Sua Aplicação de Primeiro Toque.

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

Observações

A InertiaRotationBehavior classe especifica como uma manipulação de rotação se comporta quando é inércia. Use a RotationBehavior propriedade caso ManipulationInertiaStarting faça o seguinte:

  • Especifique a velocidade inicial da inércia quando esta começa, definindo a InitialVelocity propriedade.

  • Especifique a rotação desejada da manipulação quando a inércia termina, definindo a DesiredRotation propriedade.

  • Especifique a desaceleração desejada da inércia definindo a DesiredDeceleration propriedade.

Define ou o DesiredRotation ou o DesiredDeceleration, mas não ambos. Quando defines uma destas propriedades, a outra é alterada para Double.NaN se tiver um valor.

Para mais informações sobre manipulações, consulte a Visão Geral de Entrada. Para um exemplo de uma aplicação que responde a manipulações, veja Guia: Criar a Sua Aplicação de Primeiro Toque.

Construtores

Name Description
InertiaRotationBehavior()

Inicializa uma nova instância da InertiaRotationBehavior classe.

Propriedades

Name Description
DesiredDeceleration

Obtém ou define a velocidade à qual a rotação desacelera em graus por milissegundo ao quadrado.

DesiredRotation

Obtém ou define a rotação, em graus, no final do movimento inercial.

InitialVelocity

Obtém ou define a taxa inicial da rotação no início da fase de inércia.

Métodos

Name Description
Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetHashCode()

Serve como função de hash predefinida.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do atual Object.

(Herdado de Object)
ToString()

Devolve uma cadeia que representa o objeto atual.

(Herdado de Object)

Aplica-se a