ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs) 方法

定義

提供 MouseLeftButtonUp 路由事件的類別處理,該事件於滑鼠指標在此控制項上方且放開滑鼠左按鈕時發生。Provides class handling for the MouseLeftButtonUp routed event that occurs when the left mouse button is released while the mouse pointer is over this control.

protected:
 override void OnMouseLeftButtonUp(System::Windows::Input::MouseButtonEventArgs ^ e);
protected override void OnMouseLeftButtonUp (System.Windows.Input.MouseButtonEventArgs e);
override this.OnMouseLeftButtonUp : System.Windows.Input.MouseButtonEventArgs -> unit
Protected Overrides Sub OnMouseLeftButtonUp (e As MouseButtonEventArgs)

參數

e
MouseButtonEventArgs

事件資料。The event data.

備註

這個執行會藉由將事件資料的屬性設為時,將事件標示為 MouseLeftButtonUp 已處理,而 Handled trueClickMode 不是設定為時 HoverThis implementation marks the MouseLeftButtonUp event as handled by setting the Handled property of the event data to true when ClickMode is not set to Hover. 若要回應 MouseLeftButtonUp 事件,請將事件處理常式附加至 PreviewMouseLeftButtonUp 事件,或 AddHandler(RoutedEvent, Delegate, Boolean) 使用 handledEventsToo 設定為的呼叫 trueTo respond to the MouseLeftButtonUp event, attach an event handler to the PreviewMouseLeftButtonUp event, or call AddHandler(RoutedEvent, Delegate, Boolean) with handledEventsToo set to true.

ClickMode 設定為是 ReleaseIsPressed true ,這個方法會引發 Click 事件。When ClickMode is set to Release is IsPressed is true, this method raises the Click event.

給繼承者的注意事項

如果您覆寫 OnMouseLeftButtonUp(MouseButtonEventArgs) ,請一律呼叫您的實作為基底執行 OnMouseLeftButtonUp(MouseButtonEventArgs)If you override OnMouseLeftButtonUp(MouseButtonEventArgs), always call the base implementation in your OnMouseLeftButtonUp(MouseButtonEventArgs) implementation. 若無法呼叫基底,會使基類無法使用類別處理常式來處理事件,這可能會變更最終類別的執行時間行為。Failure to call the base implementation prevents base classes from handling the event with a class handler, which might change the run-time behavior of the final class. 視您的需求而定,您可以在特殊處理前後呼叫基底執行。You can call the base implementation either before or after your special handling, depending on your requirements.

適用於