ContentElement.OnPreviewMouseLeftButtonUp(MouseButtonEventArgs) ContentElement.OnPreviewMouseLeftButtonUp(MouseButtonEventArgs) ContentElement.OnPreviewMouseLeftButtonUp(MouseButtonEventArgs) ContentElement.OnPreviewMouseLeftButtonUp(MouseButtonEventArgs) Method


當未處理的 PreviewMouseLeftButtonUp 路由事件到達其路由中衍生自此類別的項目時叫用。Invoked when an unhandled PreviewMouseLeftButtonUp routed event reaches an element in its route that is derived from this class. 實作這個方法可為此事件加入類別處理。Implement this method to add class handling for this event.

protected public:
 virtual void OnPreviewMouseLeftButtonUp(System::Windows::Input::MouseButtonEventArgs ^ e);
protected internal virtual void OnPreviewMouseLeftButtonUp (System.Windows.Input.MouseButtonEventArgs e);
abstract member OnPreviewMouseLeftButtonUp : System.Windows.Input.MouseButtonEventArgs -> unit
override this.OnPreviewMouseLeftButtonUp : System.Windows.Input.MouseButtonEventArgs -> unit
Protected Friend Overridable Sub OnPreviewMouseLeftButtonUp (e As MouseButtonEventArgs)


MouseButtonEventArgs MouseButtonEventArgs MouseButtonEventArgs MouseButtonEventArgs

包含事件資料的 MouseButtonEventArgsThe MouseButtonEventArgs that contains the event data. 事件資料會報告已放開滑鼠左鍵。The event data reports that the left mouse button was released.


PreviewMouseLeftButtonUp事件似乎旅遊通道的路由,但實際上會以間接方式傳送。The PreviewMouseLeftButtonUp event appears to travel a tunneling route but actually travels in an indirect way. Mouse.PreviewMouseUp 為基礎的事件通道路由傳送,且每個ContentElement沿著事件路由會使用相同的處理結果來引發直接路由的事件PreviewMouseLeftButtonUpMouse.PreviewMouseUp is the underlying event that is tunnel routed, and each ContentElement along the event route uses identical handling to raise the direct routed event PreviewMouseLeftButtonUp. 雖然您可以將標記PreviewMouseLeftButtonUp事件為已處理的這個項目的用途,已處理的狀態不保存事件路由中的其他項目。Although you can mark the PreviewMouseLeftButtonUp event as handled for purposes of this element, the handled state does not perpetuate to other elements along the event route. 不過,您可能想要將事件標示為已處理,以避免一般的執行個體處理常式 (未指定的指handledEventsToo) 叫用。However, you might want to mark the event as handled in order to prevent general instance handlers (those that did not specify handledEventsToo) from being invoked.

一般的滑鼠事件處理中的預設實作ContentElement接聽Mouse.PreviewMouseUp並將它轉換成適當的本機事件。The default implementation for general mouse event handling in ContentElement listens for Mouse.PreviewMouseUp and converts it to an appropriate local event. 如果您想要覆寫此邏輯,您必須建立衍生的類別。If you want to override this logic, you must create a derived class. 在衍生類別的靜態建構函式中註冊替代的類別處理常式Mouse.PreviewMouseUpIn the static constructor of your derived class, register an alternative class handler for Mouse.PreviewMouseUp. 您無法變更處理行為的滑鼠ContentElement藉由覆寫OnPreviewMouseLeftButtonUpYou cannot change the mouse handling behavior of ContentElement by overriding OnPreviewMouseLeftButtonUp.