Bagikan melalui


InertiaExpansionBehavior Kelas

Definisi

Mengontrol perusakan manipulasi pengulangan ukuran selama inertia.

public ref class InertiaExpansionBehavior
public class InertiaExpansionBehavior
type InertiaExpansionBehavior = class
Public Class InertiaExpansionBehavior
Warisan
InertiaExpansionBehavior

Contoh

Contoh berikut menunjukkan ManipulationInertiaStarting penanganan aktivitas dan mengatur deselerasi yang diinginkan untuk terjemahan, ekspansi, dan rotasi yang digunakan selama inertia. Contoh ini adalah bagian dari contoh yang lebih besar dalam Panduan: Membuat Aplikasi Sentuhan Pertama Anda.

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

Keterangan

Kelas InertiaExpansionBehavior menentukan bagaimana manipulasi ekspansi bersifat ketika inertia. ExpansionBehavior Gunakan properti dalam ManipulationInertiaStarting peristiwa untuk melakukan hal berikut:

  • Tentukan kecepatan awal inertia saat dimulai dengan mengatur InitialVelocity properti.

  • Tentukan perluasan manipulasi yang diinginkan saat inertia berakhir dengan mengatur DesiredExpansion properti .

  • Tentukan deselerasi inertia yang diinginkan dengan mengatur DesiredDeceleration properti .

Atur DesiredExpansionDesiredDecelerationatau , tetapi tidak keduanya. Saat Anda mengatur salah satu properti ini, properti lainnya diubah menjadi Double.NaN jika memiliki nilai.

Untuk informasi selengkapnya tentang manipulasi, lihat Gambaran Umum Input. Untuk contoh aplikasi yang merespons manipulasi, lihat Panduan: Membuat Aplikasi Sentuhan Pertama Anda.

Konstruktor

Nama Deskripsi
InertiaExpansionBehavior()

Menginisialisasi instans baru dari kelas InertiaExpansionBehavior.

Properti

Nama Deskripsi
DesiredDeceleration

Mendapatkan atau mengatur laju yang mengubah ukuran melambat dalam unit independen perangkat (1/96 inci per unit) per milidetik persegi.

DesiredExpansion

Mendapatkan atau mengatur jumlah yang mengubah ukuran elemen di akhir inertia.

InitialRadius

Mendapatkan atau mengatur radius rata-rata awal.

InitialVelocity

Mendapatkan atau mengatur laju awal yang mengubah ukuran elemen pada awal inertia.

Metode

Nama Deskripsi
Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Berlaku untuk