CommandManager.RemovePreviewExecutedHandler Método

Definição

Desanexa o ExecutedRoutedEventHandler especificado do elemento especificado.

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)

Parâmetros

element
UIElement

O elemento do qual remover handler.

handler
ExecutedRoutedEventHandler

O manipulador executado.

Exceções

element ou handler é null.

Exemplos

O exemplo a seguir desanexa um CanExecuteRoutedEventHandler e um ExecutedRoutedEventHandler que haviam sido anexados anteriormente a um Button.

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

Aplica-se a

Confira também