CommandManager.RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) CommandManager.RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) CommandManager.RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) CommandManager.RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) Method

定義

指定した CanExecuteRoutedEventHandler の割り当てを、指定した要素から解除します。Detaches the specified CanExecuteRoutedEventHandler from the specified element.

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)

パラメーター

element
UIElement UIElement UIElement UIElement

handler の削除元の要素。The element to remove handler from.

例外

element または handlernull です。element or handler is null.

次の例ではCanExecuteRoutedEventHandlerButton以前ExecutedRoutedEventHandlerににアタッチされていたとをデタッチします。The following example detaches a CanExecuteRoutedEventHandler and an ExecutedRoutedEventHandler which had previously been attached to a Button.

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

適用対象

こちらもご覧ください