Export (0) Print
Expand All

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
)
protected void OnContextMenuOpening (
	ContextMenuEventArgs e
)
protected override function OnContextMenuOpening (
	e : ContextMenuEventArgs
)
You cannot use methods in XAML.

Parameters

e

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 provides the means to handle the matching event from derived classes with 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, not necessarily the element that will invoke handlers, so your implementation will need to take the event arguments' source properties into account (and should not try to re-raise the event in most cases). Subclasses of TextBoxBase could call private class handler methods when the event is received along the route. One potential scenario is to take the arguments of the event and deliberately mark the event as handled.

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

Community Additions

ADD
Show:
© 2014 Microsoft