CommandManager.RemovePreviewCanExecuteHandler Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Scollega l'oggetto specificato CanExecuteRoutedEventHandler dall'elemento specificato.
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)
Parametri
- element
- UIElement
Elemento da cui rimuovere handler .
- handler
- CanExecuteRoutedEventHandler
L'oggetto può eseguire il gestore.
Eccezioni
element o handler è null.
Esempio
Nell'esempio seguente viene scollegato un CanExecuteRoutedEventHandler oggetto e un oggetto ExecutedRoutedEventHandler collegato in precedenza a un oggetto Button.
CommandManager.RemoveExecutedHandler(helpButton, HelpCmdExecuted);
CommandManager.RemoveCanExecuteHandler(helpButton, HelpCmdCanExecute);
CommandManager.RemoveExecutedHandler(helpButton, AddressOf HelpCmdExecuted)
CommandManager.RemoveCanExecuteHandler(helpButton, AddressOf HelpCmdCanExecute)