UIElement.ManipulationInertiaStarting Evento
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Si verifica quando il dispositivo di input perde il contatto con l'oggetto durante una manipolazione e inizia l'inerzia UIElement .
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
L'esempio seguente mostra il ManipulationInertiaStarting gestore eventi e imposta la decelerazione desiderata per traslazione, espansione e rotazione utilizzata 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" un'eccezione UIElement su una superficie, l'utente tocca per UIElement avviare l'azione, sposta il dito sullo schermo per una breve distanza e 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 l'inerzia si sta verificando sull'elemento .
È possibile utilizzare questo evento per specificare il comportamento dell'inerzia. Ad esempio, è possibile impostare la velocità iniziale usata all'inizio dell'inerzia. È 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 (conversione, 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 modifiche, vedere Procedura dettagliata: Creazione della prima applicazione touch.
Informazioni sugli eventi indirizzati
| Item | Value |
|---|---|
| Campo Identificatore | ManipulationInertiaStartingEvent |
| Strategia di routing | Bubbling |
| Delegato | EventHandler<TEventArgs> di tipo ManipulationInertiaStartingEventArgs. |