UIElement.ManipulationInertiaStarting Evento

Definición

Se produce cuando el dispositivo de entrada pierde contacto con el UIElement objeto durante una manipulación y comienza la inercia.

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

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

El ManipulationInertiaStarting evento se produce cuando el usuario levanta todos los dedos de la pantalla durante una manipulación. Por ejemplo, si un usuario "inicia" un UIElement elemento a través de una superficie, el usuario tocará para UIElement comenzar la acción, moverá el dedo a través de la pantalla durante una corta distancia y, a continuación, liberará .UIElement Cuando el usuario libera el elemento, comienza la inercia y se produce el ManipulationInertiaStarting evento. UIElement continúa recibiendo ManipulationDelta eventos para indicar que se está produciendo inercia en el elemento .

Puede usar este evento para especificar el comportamiento de la inercia. Por ejemplo, puede establecer la velocidad inicial que se usa cuando comienza la inercia. También puede especificar la cantidad de inercia estableciendo la desaceleración deseada o estableciendo la ubicación deseada. Puede establecer estos valores para cada tipo de manipulación (traducción, expansión o rotación) de forma independiente. Para obtener más información, consulte ManipulationInertiaStartingEventArgs.

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.

Información del evento enrutado

Elemento Value
Campo identificador ManipulationInertiaStartingEvent
Estrategia de enrutamiento Bubbling
Delegado EventHandler<TEventArgs> de tipo ManipulationInertiaStartingEventArgs.

Se aplica a