Język

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 ustawiana jest żądana zwalnianie na potrzeby tłumaczenia, rozszerzania i obrotu używanego 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 manipulacji. Jeśli na przykład użytkownik "rzuca" UIElement na powierzchnię, użytkownik będzie dotykał UIElement elementu , aby rozpocząć akcję, przesunąć palcem przez ekran na krótką odległość, a następnie zwolnić UIElementelement . 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 manipulacji (tłumaczenie, rozszerzanie lub rotacja) niezależnie. Aby uzyskać więcej informacji, zobacz ManipulationInertiaStartingEventArgs.

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

Informacje o zdarzeniach kierowanych

Przedmiot Wartość
Pole identyfikatora ManipulationInertiaStartingEvent
Strategia routingu Propagacji
Delegat EventHandler<TEventArgs> typu ManipulationInertiaStartingEventArgs.

Dotyczy