ManipulationInertiaStartingEventArgs 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 ManipulationInertiaStarting 事件的資料。
public ref class ManipulationInertiaStartingEventArgs sealed : System::Windows::Input::InputEventArgs
public sealed class ManipulationInertiaStartingEventArgs : System.Windows.Input.InputEventArgs
type ManipulationInertiaStartingEventArgs = class
inherit InputEventArgs
Public NotInheritable Class ManipulationInertiaStartingEventArgs
Inherits InputEventArgs
- 繼承
範例
以下範例展示了 ManipulationInertiaStarting 事件處理程序,並設定慣性期間所需的平移、膨脹與旋轉減速。 這個範例是《 Walkthrough: Creating Your First Touch Application》中一個更大範例的一部分。
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
備註
你可以用這個 ManipulationInertiaStartingEventArgs 物件來指定操作的慣性行為。 你可以分別使用 TranslationBehavior、 ExpansionBehavior、 和 RotationBehavior 性質來指定每種操作類型的慣性行為。 每個屬性都是一種物件類型,代表慣性行為,在每種情況下,你可以指定以下內容:
慣性開始時的初始速度。
慣性結束時操控的期望位置。
慣性所需的減速。
通常你會指定慣性結束時操控的期望位置或慣性的減速方向,但不會兩者兼具。
欲了解更多操作資訊,請參閱 輸入概述。
屬性
| 名稱 | Description |
|---|---|
| Device |
取得觸發此事件的輸入裝置。 (繼承來源 InputEventArgs) |
| ExpansionBehavior |
取得或設定膨脹減速的慣性運動速率。 |
| Handled |
取得或設定一個值,表示路由事件在路徑上處理事件的當前狀態。 (繼承來源 RoutedEventArgs) |
| InitialVelocities |
取得慣性開始前操控變化速率。 |
| ManipulationContainer |
取得該 ManipulationOrigin 屬性相對於的容器。 |
| ManipulationOrigin |
取得或設定操作起源點。 |
| Manipulators |
會得到一組代表觸控接觸點的物件,方便操作。 |
| OriginalSource |
取得原始報告來源,這是根據純命中測試確定的,且不會 Source 被父類別可能調整。 (繼承來源 RoutedEventArgs) |
| RotationBehavior |
它能設定旋轉慣性運動的減速速率。 |
| RoutedEvent |
取得或設定與此RoutedEvent實例相關的 。RoutedEventArgs (繼承來源 RoutedEventArgs) |
| Source |
取得或設定一個指向引發事件的物件的參考。 (繼承來源 RoutedEventArgs) |
| Timestamp |
取得事件發生的時間點。 (繼承來源 InputEventArgs) |
| TranslationBehavior |
它能設定線性慣性運動的減速速率。 |
方法
| 名稱 | Description |
|---|---|
| Cancel() |
取消操控。 |
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| InvokeEventHandler(Delegate, Object) |
以特定類型的方式呼叫事件處理程序,能提升事件系統效率。 (繼承來源 InputEventArgs) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| OnSetSource(Object) |
當在衍生類別中覆寫時,當實例屬性的值 Source 改變時,會提供一個通知回調入口點。 (繼承來源 RoutedEventArgs) |
| SetInertiaParameter(InertiaParameters2D) |
指定慣性期間操控的行為。 |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |