UIElement.ManipulationInertiaStarting Zdarzenie

Definicja

Występuje, gdy urządzenie wejściowe traci kontakt z UIElement obiektem podczas manipulowania i rozpoczyna się inercja.

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) 

Typ zdarzenia

Przykłady

W poniższym przykładzie przedstawiono procedurę ManipulationInertiaStarting obsługi zdarzeń i ustawia żądaną dekodację tłumaczenia, rozszerzania i rotacji używanej podczas inercji. Ten przykład jest częścią większego przykładu w przewodniku: tworzenie pierwszej aplikacji dotykowej.

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

Uwagi

Zdarzenie ManipulationInertiaStarting występuje, gdy użytkownik podnosi wszystkie palce z ekranu podczas manipulowania. Jeśli na przykład użytkownik "rzuca" UIElement na powierzchnię, użytkownik będzie dotykać UIElement , aby rozpocząć akcję, przenieść palcem przez ekran na krótką odległość, a następnie zwolnić UIElement. Gdy użytkownik zwalnia element, inercja rozpoczyna się i ManipulationInertiaStarting występuje zdarzenie. W UIElement dalszym ciągu odbierane ManipulationDelta są zdarzenia wskazujące, że inercja występuje w elemecie .

To zdarzenie służy do określania zachowania inercji. Można na przykład ustawić początkową szybkość, która jest używana podczas rozpoczęcia inercji. Można również określić ilość inercji, ustawiając żądane opóźnienie lub ustawiając żądane rozmieszczenie. Można ustawić te wartości dla każdego typu manipulowania (tłumaczenia, rozszerzania lub rotacji) niezależnie. Aby uzyskać więcej informacji, zobacz ManipulationInertiaStartingEventArgs.

Aby uzyskać więcej informacji na temat manipulacji, zobacz Omówienie danych wejściowych. Przykład aplikacji, która reaguje na manipulacje, zobacz Przewodnik: tworzenie pierwszej aplikacji dotykowej.

Informacje dotyczące kierowanego zdarzenia

Pole identyfikatora ManipulationInertiaStartingEvent
Strategia routingu Propagacji
Delegat EventHandler<TEventArgs> typu ManipulationInertiaStartingEventArgs.

Dotyczy