UIElement.ManipulationInertiaStarting Událost

Definice

Nastane, když vstupní zařízení ztratí kontakt s objektem UIElement během manipulace a začne setrvačnost.

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) 

Event Type

Příklady

Následující příklad ukazuje obslužnou rutinu ManipulationInertiaStarting události a nastaví požadované zpomalení pro překlad, rozšíření a otočení, které se používá během setrvačnosti. Tento příklad je součástí rozsáhlejšího příkladu v návodu: Vytvoření aplikace prvního dotyku.

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

Poznámky

K ManipulationInertiaStarting této události dojde, když uživatel během manipulace zvedne z obrazovky všechny prsty. Pokud například uživatel "hodí" UIElement přes povrch, uživatel se dotkne UIElement , aby zahájil akci, na krátkou vzdálenost posune prst přes obrazovku a pak uvolní UIElement. Když uživatel prvek uvolní, začne setrvačnost a dojde k ManipulationInertiaStarting události. Pokračuje UIElement přijímat ManipulationDelta události, které označují, že na elementu dochází k setrvačnosti.

Tuto událost můžete použít k určení chování setrvačnosti. Můžete například nastavit počáteční rychlost, která se použije při zahájení setrvačnosti. Můžete také určit míru setrvačnosti nastavením požadovaného zpomalení nebo nastavením požadovaného umístění. Tyto hodnoty můžete nastavit pro každý typ manipulace (překlad, rozšíření nebo otočení) nezávisle na sobě. Další informace naleznete v tématu ManipulationInertiaStartingEventArgs.

Další informace o manipulaci najdete v přehledu vstupu. Příklad aplikace, která reaguje na manipulaci, najdete v tématu Návod: Vytvoření aplikace prvního dotyku.

Informace o směrované události

Pole Identifikátor ManipulationInertiaStartingEvent
Strategie směrování Bublající
Delegát EventHandler<TEventArgs> typu ManipulationInertiaStartingEventArgs.

Platí pro