UIElement.ManipulationInertiaStarting Evento

Definizione

Si verifica quando il dispositivo di input perde contatto con l'oggetto UIElement durante una manipolazione e inizia un'inerzia.

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 evento

Esempio

Nell'esempio seguente viene illustrato il ManipulationInertiaStarting gestore eventi e viene impostata la decelerazione desiderata per la conversione, l'espansione e la rotazione usata durante l'inerzia. Questo esempio fa parte di un esempio più ampio in Procedura dettagliata: Creazione della prima applicazione touch.

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

Commenti

L'evento ManipulationInertiaStarting si verifica quando l'utente solleva tutte le dita dallo schermo durante una manipolazione. Ad esempio, se un utente "genera" una UIElement superficie, l'utente tocca l'oggetto UIElement per avviare l'azione, sposta il dito sullo schermo per una breve distanza e quindi rilascia .UIElement Quando l'utente rilascia l'elemento, inizia l'inerzia e si verifica l'evento ManipulationInertiaStarting . Continua UIElement a ricevere ManipulationDelta eventi per indicare che si sta verificando l'inerzia nell'elemento.

È possibile usare questo evento per specificare il comportamento dell'inerzia. Ad esempio, è possibile impostare la velocità iniziale usata quando inizia l'inertia. È anche possibile specificare la quantità di inerzia impostando la decelerazione desiderata o impostando il posizionamento desiderato. È possibile impostare questi valori per ogni tipo di manipolazione (traduzione, espansione o rotazione) in modo indipendente. Per altre informazioni, vedere ManipulationInertiaStartingEventArgs.

Per altre informazioni sulle manipolazioni, vedere Panoramica dell'input. Per un esempio di applicazione che risponde alle manipolazioni, vedere Procedura dettagliata: Creazione della prima applicazione touch.

Informazioni evento indirizzato

Campo Identificatore ManipulationInertiaStartingEvent
Strategia di routing Bubbling
Delegato EventHandler<TEventArgs> di tipo ManipulationInertiaStartingEventArgs.

Si applica a