InertiaRotationBehavior Kelas
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mengontrol perampasan manipulasi rotasi selama inertia.
public ref class InertiaRotationBehavior
public class InertiaRotationBehavior
type InertiaRotationBehavior = class
Public Class InertiaRotationBehavior
- Warisan
-
InertiaRotationBehavior
Contoh
Contoh berikut menunjukkan penanganan ManipulationInertiaStarting aktivitas dan mengatur deselerasi yang diinginkan untuk terjemahan, ekspansi, dan rotasi yang digunakan selama inertia. Contoh ini adalah bagian dari contoh yang lebih besar di Walkthrough: 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 InertiaRotationBehavior menentukan bagaimana manipulasi rotasi berkinerja ketika inertia. RotationBehavior Gunakan properti dalam ManipulationInertiaStarting peristiwa untuk melakukan hal berikut:
Tentukan kecepatan awal inertia saat dimulai dengan mengatur InitialVelocity properti .
Tentukan rotasi manipulasi yang diinginkan saat inertia berakhir dengan mengatur DesiredRotation properti .
Tentukan deselerasi inertia yang diinginkan dengan mengatur DesiredDeceleration properti .
Atur DesiredRotationDesiredDecelerationatau , 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
InertiaRotationBehavior() |
Menginisialisasi instans baru kelas InertiaRotationBehavior. |
Properti
DesiredDeceleration |
Mendapatkan atau mengatur laju rotasi melambat dalam derajat per milidetik kuadrat. |
DesiredRotation |
Mendapatkan atau mengatur rotasi, dalam derajat, di akhir gerakan inertial. |
InitialVelocity |
Mendapatkan atau menetapkan laju awal rotasi pada awal fase inertia. |
Metode
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 instans Type saat ini. (Diperoleh dari Object) |
MemberwiseClone() |
Membuat salinan dangkal dari yang saat ini Object. (Diperoleh dari Object) |
ToString() |
Mengembalikan string yang mewakili objek saat ini. (Diperoleh dari Object) |