This topic has not yet been rated - Rate this topic

TextBoxBase.OnContextMenuOpening Method

Called whenever an unhandled ContextMenuOpening routed event reaches this class in its route. Implement this method to add class handling for this event.

Namespace:  System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)
protected override void OnContextMenuOpening(
	ContextMenuEventArgs e
)

Parameters

e
Type: System.Windows.Controls.ContextMenuEventArgs

Arguments of the event.

This method has no default implementation. You should still call the base implementation in case an intermediate class in the inheritance has implemented this method.

The purpose of this method is somewhat similar to common language runtime (CLR) event pattern On* methods: it lets you handle the matching event from derived classes by using a class handler instead of an instance handler. In this case, the matching event is a routed event. The implementation pattern of the On* methods is different for routed events because the routed event might have been raised by a child element, which is not necessarily the element that invokes handlers. Therefore, your implementation needs to take the event arguments' source properties into account (and should not try to re-raise the event in most cases). Subclasses of TextBoxBase can call private class handler methods when the event is received along the route. One scenario is to take the arguments of the event and deliberately mark the event as handled.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.