Linguagem

UIElement.ManipulationInertiaStarting Evento

Definição

Ocorre quando o dispositivo de entrada perde contacto com o UIElement objeto durante uma manipulação e a inércia começa.

public:
 event EventHandler<System::Windows::Input::ManipulationInertiaStartingEventArgs ^> ^ ManipulationInertiaStarting;
public event EventHandler<System.Windows.Input.ManipulationInertiaStartingEventArgs> ManipulationInertiaStarting;
member this.ManipulationInertiaStarting : EventHandler<System.Windows.Input.ManipulationInertiaStartingEventArgs> 
Public Custom Event ManipulationInertiaStarting As EventHandler(Of ManipulationInertiaStartingEventArgs) 

Tipo de Evento

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

O ManipulationInertiaStarting evento ocorre quando o utilizador levanta todos os dedos do ecrã durante uma manipulação. Por exemplo, se um utilizador "lançar" a UIElement sobre uma superfície, o utilizador tocará no UIElement para iniciar a ação, moverá o dedo pelo ecrã por uma curta distância e depois soltará o UIElement. Quando o utilizador liberta o elemento, começa a inércia e o ManipulationInertiaStarting evento ocorre. Continua UIElement a receber ManipulationDelta eventos que indicam que está a ocorrer inércia no elemento.

Pode usar este evento para especificar o comportamento da inércia. Por exemplo, pode definir a velocidade inicial que é usada quando a inércia começa. Também pode especificar a quantidade de inércia definindo a desaceleração desejada ou definindo a posição desejada. Pode definir estes valores para cada tipo de manipulação (translação, expansão ou rotação) de forma independente. Para obter mais informações, veja ManipulationInertiaStartingEventArgs.

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.

Informação sobre Eventos Roteados

Iteme Value
Campo identificador ManipulationInertiaStartingEvent
Estratégia de encaminhamento Borbulhar
Delegar EventHandler<TEventArgs> do tipo ManipulationInertiaStartingEventArgs.

Aplica-se a