Sdílet prostřednictvím


InertiaRotationBehavior Třída

Definice

Řídí zpomalení manipulace s rotací během nečinnosti.

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

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 InertiaRotationBehavior určuje, jak se manipulace s rotací chová při nečinnosti. RotationBehavior 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 rotaci manipulace při nečinnosti DesiredRotation .

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

Nastavte buď buď nebo DesiredRotationDesiredDeceleration, 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
InertiaRotationBehavior()

Inicializuje novou instanci InertiaRotationBehavior třídy.

Vlastnosti

Name Description
DesiredDeceleration

Získá nebo nastaví rychlost otáčení pomalu ve stupních na čtvereční milisekundu.

DesiredRotation

Získá nebo nastaví otočení ve stupních na konci inerciálního pohybu.

InitialVelocity

Získá nebo nastaví počáteční rychlost otáčení 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