InertiaTranslationBehavior Classe

Definição

Controla a desaceleração numa manipulação de translação durante a inércia.

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

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 InertiaTranslationBehavior classe especifica como uma manipulação de tradução se comporta quando é inércia. Use a TranslationBehavior propriedade caso ManipulationInertiaStarting faça o seguinte:

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

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

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

Define ou o DesiredDisplacement 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
InertiaTranslationBehavior()

Inicializa uma nova instância da InertiaTranslationBehavior classe.

Propriedades

Name Description
DesiredDeceleration

Obtém ou define a velocidade a que o movimento linear abranda em unidades independentes do dispositivo (1/96 polegada por unidade) por milissegundo quadrado.

DesiredDisplacement

Obtém ou define o movimento linear da manipulação no fim da inércia.

InitialVelocity

Obtém ou define a taxa inicial de movimento linear 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