The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ContentElement.OnPreviewMouseRightButtonUp Method

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.

Namespace: System.Windows
Assembly: PresentationCore (in presentationcore.dll)

protected virtual void OnPreviewMouseRightButtonUp (
	MouseButtonEventArgs e
protected void OnPreviewMouseRightButtonUp (
	MouseButtonEventArgs e
protected function OnPreviewMouseRightButtonUp (
	e : MouseButtonEventArgs
You cannot use methods in XAML.



The MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released.

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 ContentElement 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 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. In the static constructor of your derived class, register an alternative class handler for Mouse.PreviewMouseUp. You cannot change the mouse handling behavior of ContentElement by overriding OnPreviewMouseRightButtonUp.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft