Sdílet prostřednictvím


InertiaTranslationBehavior Třída

Definice

Řídí zpomalení manipulace s překladem během nečinnosti.

public ref class InertiaTranslationBehavior
public class InertiaTranslationBehavior
type InertiaTranslationBehavior = class
Public Class InertiaTranslationBehavior
Dědičnost
InertiaTranslationBehavior

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 nečinnosti. Tento příklad je součástí většího příkladu v návodu: Vytvoření první dotykové aplikace.

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

Třída InertiaTranslationBehavior určuje, jak se manipulace s překladem chová, když je inertia. TranslationBehavior Pomocí vlastnosti v ManipulationInertiaStarting události proveďte následující akce:

  • Zadejte počáteční rychlost inertia, když začne nastavením InitialVelocity vlastnosti.

  • Nastavením vlastnosti určete požadovanou pozici manipulace při nečinnosti DesiredDisplacement .

  • Nastavením vlastnosti určete požadované zpomalení inertia DesiredDeceleration .

Nastavte buď buď nebo DesiredDisplacementDesiredDeceleration, ale ne obojí. Když nastavíte jednu z těchto vlastností, druhá vlastnost se změní na Double.NaN , pokud má hodnotu.

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

Konstruktory

Name Description
InertiaTranslationBehavior()

Inicializuje novou instanci InertiaTranslationBehavior třídy.

Vlastnosti

Name Description
DesiredDeceleration

Získá nebo nastaví rychlost lineárního pohybu zpomaluje v jednotkách nezávislých na zařízení (1/96 palce na jednotku) na čtvereční milisekundu.

DesiredDisplacement

Získá nebo nastaví lineární pohyb manipulace na konci inertia.

InitialVelocity

Získá nebo nastaví počáteční rychlost lineárního pohybu na začátku fáze inertia.

Metody

Name Description
Equals(Object)

Určuje, zda je zadaný objekt roven aktuálnímu objektu.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí funkce hash.

(Zděděno od Object)
GetType()

Získá Type aktuální instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Object.

(Zděděno od Object)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Platí pro