CommandManager.RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) CommandManager.RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) CommandManager.RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) CommandManager.RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) Method

Definition

Detaches the specified ExecutedRoutedEventHandler from the specified element.

public:
 static void RemovePreviewExecutedHandler(System::Windows::UIElement ^ element, System::Windows::Input::ExecutedRoutedEventHandler ^ handler);
public static void RemovePreviewExecutedHandler (System.Windows.UIElement element, System.Windows.Input.ExecutedRoutedEventHandler handler);
static member RemovePreviewExecutedHandler : System.Windows.UIElement * System.Windows.Input.ExecutedRoutedEventHandler -> unit
Public Shared Sub RemovePreviewExecutedHandler (element As UIElement, handler As ExecutedRoutedEventHandler)

Parameters

element
UIElement UIElement UIElement UIElement

The element to remove handler from.

Exceptions

Examples

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);
CommandManager.RemoveExecutedHandler(helpButton, AddressOf HelpCmdExecuted)
CommandManager.RemoveCanExecuteHandler(helpButton, AddressOf HelpCmdCanExecute)

Applies to

See also