CommandManager CommandManager CommandManager CommandManager Class

定義

CommandBinding オブジェクトと InputBinding オブジェクトをクラス所有者およびコマンドに登録するコマンド関連ユーティリティ メソッドの提供、コマンドのイベント ハンドラーの追加と削除、およびコマンド ステータスの照会サービスの提供を行います。Provides command related utility methods that register CommandBinding and InputBinding objects for class owners and commands, add and remove command event handlers, and provides services for querying the status of a command.

public ref class CommandManager sealed
public sealed class CommandManager
type CommandManager = class
Public NotInheritable Class CommandManager
継承
CommandManagerCommandManagerCommandManagerCommandManager

注釈

CommandManager 、ルーティングコマンドの管理を担当します。The CommandManager is responsible for managing routed commands. コマンドの詳細については、「コマンドの概要」を参照してください。For more information about commanding, see Commanding Overview.

インスタンスRegisterClassCommandBindingではなくCommandBinding 、をクラスに登録するには、を使用します。Use RegisterClassCommandBinding to register a CommandBinding to a class as opposed to an instance.

インスタンスRegisterClassInputBindingではなくInputBinding 、をクラスに登録するには、を使用します。Use RegisterClassInputBinding to register an InputBinding to a class as opposed to an instance.

InvalidateRequerySuggested メソッドは、CommandManagerRequerySuggested イベントを強制的に発生させます。The InvalidateRequerySuggested method forces the CommandManager to raise the RequerySuggested event. イベントRequerySuggestedは、コマンドを実行できるかどうかを判断するために、関連付けられているコマンドに対してクエリを実行するようコマンドソースに通知します。The RequerySuggested event informs a command source to query the command it is associated with to determine whether or not the command can execute.

フィールド

CanExecuteEvent CanExecuteEvent CanExecuteEvent CanExecuteEvent

CanExecute 添付イベントを識別します。Identifies the CanExecute attached event.

ExecutedEvent ExecutedEvent ExecutedEvent ExecutedEvent

Executed 添付イベントを識別します。Identifies the Executed attached event.

PreviewCanExecuteEvent PreviewCanExecuteEvent PreviewCanExecuteEvent PreviewCanExecuteEvent

PreviewCanExecute 添付イベントを識別します。Identifies the PreviewCanExecute attached event.

PreviewExecutedEvent PreviewExecutedEvent PreviewExecutedEvent PreviewExecutedEvent

PreviewExecuted 添付イベントを識別します。Identifies the PreviewExecuted attached event.

メソッド

AddCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) AddCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) AddCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) AddCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)

指定した CanExecuteRoutedEventHandler を指定した要素に割り当てます。Attaches the specified CanExecuteRoutedEventHandler to the specified element.

AddExecutedHandler(UIElement, ExecutedRoutedEventHandler) AddExecutedHandler(UIElement, ExecutedRoutedEventHandler) AddExecutedHandler(UIElement, ExecutedRoutedEventHandler) AddExecutedHandler(UIElement, ExecutedRoutedEventHandler)

指定した ExecutedRoutedEventHandler を指定した要素に割り当てます。Attaches the specified ExecutedRoutedEventHandler to the specified element.

AddPreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) AddPreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) AddPreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) AddPreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)

指定した CanExecuteRoutedEventHandler を指定した要素に割り当てます。Attaches the specified CanExecuteRoutedEventHandler to the specified element.

AddPreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) AddPreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) AddPreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) AddPreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler)

指定した ExecutedRoutedEventHandler を指定した要素に割り当てます。Attaches the specified ExecutedRoutedEventHandler to the specified element.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

既定のハッシュ関数として機能します。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
InvalidateRequerySuggested() InvalidateRequerySuggested() InvalidateRequerySuggested() InvalidateRequerySuggested()

CommandManager に、RequerySuggested イベントを強制的に発生させます。Forces the CommandManager to raise the RequerySuggested event.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
RegisterClassCommandBinding(Type, CommandBinding) RegisterClassCommandBinding(Type, CommandBinding) RegisterClassCommandBinding(Type, CommandBinding) RegisterClassCommandBinding(Type, CommandBinding)

指定した型に CommandBinding を登録します。Registers a CommandBinding with the specified type.

RegisterClassInputBinding(Type, InputBinding) RegisterClassInputBinding(Type, InputBinding) RegisterClassInputBinding(Type, InputBinding) RegisterClassInputBinding(Type, InputBinding)

指定した型に、指定した InputBinding を登録します。Registers the specified InputBinding with the specified type.

RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)

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

RemoveExecutedHandler(UIElement, ExecutedRoutedEventHandler) RemoveExecutedHandler(UIElement, ExecutedRoutedEventHandler) RemoveExecutedHandler(UIElement, ExecutedRoutedEventHandler) RemoveExecutedHandler(UIElement, ExecutedRoutedEventHandler)

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

RemovePreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) RemovePreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) RemovePreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) RemovePreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler)

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

RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler)

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

ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)

イベント

RequerySuggested RequerySuggested RequerySuggested RequerySuggested

コマンドを実行できるかどうかを変更する可能性のある条件が CommandManager によって検出された場合に発生します。Occurs when the CommandManager detects conditions that might change the ability of a command to execute.

添付イベント

CanExecute CanExecute CanExecute CanExecute

CanExecute(Object, IInputElement)RoutedCommand メソッドが呼び出され、PreviewCanExecute イベントが処理されなかったときに発生します。Occurs when the CanExecute(Object, IInputElement) method on the RoutedCommand is called and the PreviewCanExecute event was not handled.

Executed Executed Executed Executed

Execute(Object, IInputElement)RoutedCommand メソッドが呼び出され、PreviewExecuted イベントが処理されなかったときに発生します。Occurs when the Execute(Object, IInputElement) method on the RoutedCommand is called and the PreviewExecuted event was not handled.

PreviewCanExecute PreviewCanExecute PreviewCanExecute PreviewCanExecute

CanExecute(Object, IInputElement)RoutedCommand メソッドが呼び出されると発生します。Occurs when the CanExecute(Object, IInputElement) method on the RoutedCommand is called.

PreviewExecuted PreviewExecuted PreviewExecuted PreviewExecuted

Execute(Object, IInputElement)RoutedCommand メソッドが呼び出されると発生します。Occurs when the Execute(Object, IInputElement) method on the RoutedCommand is called.

適用対象

こちらもご覧ください