CommandManager.RemovePreviewExecutedHandler Method (UIElement, ExecutedRoutedEventHandler)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Detaches the specified ExecutedRoutedEventHandler from the specified element.

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

public static void RemovePreviewExecutedHandler(
	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.

Exception Condition
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
Available since 3.0
Return to top
Show: