Compartilhar via


CommandManager.RemovePreviewCanExecuteHandler Método

Definição

Desanexa o CanExecuteRoutedEventHandler especificado do elemento especificado.

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