UIElement.ManipulationStarting 事件

定義

發生於第一次建立操作處理器時。

public:
 virtual event ManipulationStartingEventHandler ^ ManipulationStarting;
// Register
event_token ManipulationStarting(ManipulationStartingEventHandler const& handler) const;

// Revoke with event_token
void ManipulationStarting(event_token const* cookie) const;

// Revoke with event_revoker
UIElement::ManipulationStarting_revoker ManipulationStarting(auto_revoke_t, ManipulationStartingEventHandler const& handler) const;
public event ManipulationStartingEventHandler ManipulationStarting;
function onManipulationStarting(eventArgs) { /* Your code */ }
uIElement.addEventListener("manipulationstarting", onManipulationStarting);
uIElement.removeEventListener("manipulationstarting", onManipulationStarting);
- or -
uIElement.onmanipulationstarting = onManipulationStarting;
Public Custom Event ManipulationStarting As ManipulationStartingEventHandler 
<uiElement ManipulationStarting="eventhandler"/>

事件類型

備註

如需自訂控制項和互動體驗,請參閱 GestureRecognizer

元素必須有NoneSystem以外的ManipulationMode值,才能成為操作事件來源。 ManipulationMode的預設值是System,可讓內建控制項邏輯處理操作,但不允許應用程式程式碼處理操作事件。 如果您想要處理操作,請將 ManipulationMode 設定為 All,或設定為特定的 ManipulationModes 值。 如需詳細資訊,請參閱 ManipulationMode

ManipulationStarting 基本上會在指標與元素啟用操作的專案互動時引發。 這包括將操作解譯為手勢,而指標永遠不會移動的情況,例如 點選按住 手勢。 如果指標確實移動, ManipulationStarted 通常會在之後引發。

ManipulationStarting 是路由事件。 如果允許事件反升至父元素,因為它未處理,則即使 ManipulationModeNone 或父元素上的 System ,也可以處理父元素上的事件。 如需路由事件概念的詳細資訊,請參閱 事件和路由事件概觀

對於觸控動作以及因為觸控動作而引發的互動特定或操作事件,元素必須具有點擊測試可見性,才能成為事件來源並引發與動作相關聯的事件。 UIElement.Visibility 必須是 Visible。 衍生類型的其他屬性也會影響點擊測試可見度。 如需詳細資訊,請參閱事件與路由事件概觀

ManipulationStarting 支援將事件處理常式附加至將叫用的路由,即使事件的事件資料標示為 Handled 也一樣。 請參閱 AddHandler

Windows 8 行為

如果短時間內發生多個手勢,Windows 8 就會發生引發此事件的問題。 例如,Windows 8 可能只會針對第一個手勢引發 ManipulationStarting,而不是第二個手勢。 此問題從 Windows 8.1 開始修正;輸入系統處理的多個起始手勢會引發不同的 ManipulationStarting 事件。

針對 Windows 8 編譯但在 Windows 8.1 上執行的應用程式會繼續使用 Windows 8 的行為。

適用於

另請參閱