Share via


InertiaRotationBehavior Třída

Definice

Řídí zpomalení manipulace s otáčením během setrvačnosti.

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

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 otáčením chová, když je setrvačná. RotationBehavior Pomocí vlastnosti v ManipulationInertiaStarting události proveďte následující akce:

  • Nastavením vlastnosti určete počáteční rychlost setrvačnosti na začátku InitialVelocity .

  • Nastavením vlastnosti určete požadované otočení manipulace při ukončení setrvačnosti DesiredRotation .

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

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

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 dotykového ovládání.

Konstruktory

InertiaRotationBehavior()

Inicializuje novou instanci InertiaRotationBehavior třídy.

Vlastnosti

DesiredDeceleration

Získá nebo nastaví rychlost zpomalení otáčení ve stupních na druhou milisekundu.

DesiredRotation

Získá nebo nastaví rotaci 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 setrvačnosti.

Metody

Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.

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

Slouží jako výchozí hashovací funkce.

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

Získá aktuální Type instanci.

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

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

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

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

(Zděděno od Object)

Platí pro