Partilhar via


CommandManager.RemoveExecutedHandler Método

Definição

Desanexa o ExecutedRoutedEventHandler especificado do elemento especificado.

public:
 static void RemoveExecutedHandler(System::Windows::UIElement ^ element, System::Windows::Input::ExecutedRoutedEventHandler ^ handler);
public static void RemoveExecutedHandler (System.Windows.UIElement element, System.Windows.Input.ExecutedRoutedEventHandler handler);
static member RemoveExecutedHandler : System.Windows.UIElement * System.Windows.Input.ExecutedRoutedEventHandler -> unit
Public Shared Sub RemoveExecutedHandler (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