UIElement.OnPreviewMouseRightButtonUp(MouseButtonEventArgs) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Invoked when an unhandled PreviewMouseRightButtonUp 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:
virtual void OnPreviewMouseRightButtonUp(System::Windows::Input::MouseButtonEventArgs ^ e);
protected virtual void OnPreviewMouseRightButtonUp (System.Windows.Input.MouseButtonEventArgs e);
abstract member OnPreviewMouseRightButtonUp : System.Windows.Input.MouseButtonEventArgs -> unit
override this.OnPreviewMouseRightButtonUp : System.Windows.Input.MouseButtonEventArgs -> unit
Protected Overridable Sub OnPreviewMouseRightButtonUp (e As MouseButtonEventArgs)
Parameters
The MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released.
Remarks
The PreviewMouseRightButtonUp event appears to travel a tunneling route but actually travels in an indirect way. Mouse.PreviewMouseUp is the underlying event that is tunnel routed, and each UIElement along the event route uses identical handling to raise the direct routed event PreviewMouseRightButtonUp. Although you can mark the PreviewMouseRightButtonUp event as handled for purposes of this element, the handled state does not perpetuate to other elements along the event route. 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.
The default implementation for general mouse event handling in UIElement 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. In the static constructor of your derived class, register an alternative class handler for Mouse.PreviewMouseUp. You cannot change the mouse handling behavior of UIElement by overriding OnPreviewMouseRightButtonUp.