CommandManager.RemoveExecutedHandler Method

Detaches the specified ExecutedRoutedEventHandler from the specified element.

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

public static void RemoveExecutedHandler(
	UIElement element,
	ExecutedRoutedEventHandler handler
)

Parameters

element
Type: System.Windows.UIElement

The element to remove handler from.

handler
Type: System.Windows.Input.ExecutedRoutedEventHandler

The executed handler.

ExceptionCondition
ArgumentNullException

element or handler is null.

The following example detaches a CanExecuteRoutedEventHandler and an ExecutedRoutedEventHandler which had previously been attached to a Button.

CommandManager.RemoveExecutedHandler(helpButton, HelpCmdExecuted);
CommandManager.RemoveCanExecuteHandler(helpButton, HelpCmdCanExecute);

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft