Compartilhar via


CommandManager.RemoveCanExecuteHandler Método

Definição

Desanexa o CanExecuteRoutedEventHandler especificado do elemento especificado.

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

Parâmetros

element
UIElement

O elemento do qual remover handler.

handler
CanExecuteRoutedEventHandler

O manipulador can execute.

Exceções

element ou handler é null.

Exemplos

O exemplo a seguir desanexa um CanExecuteRoutedEventHandler e um ExecutedRoutedEventHandler que havia sido anexado 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