CommandManager Klasa
Definicja
Udostępnia metody narzędziowe związane z poleceniami, które rejestrują CommandBinding i InputBinding obiektów dla właścicieli i poleceń klasy, dodają i usuwają programy obsługi zdarzeń, a także udostępniają usługi do wykonywania zapytań dotyczących stanu polecenia.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
- Dziedziczenie
-
CommandManager
Uwagi
CommandManagerJest odpowiedzialny za zarządzanie poleceniami kierowanymi.The CommandManager is responsible for managing routed commands. Aby uzyskać więcej informacji na temat poleceń, zobacz Omówienie poleceń.For more information about commanding, see Commanding Overview.
Użyj, RegisterClassCommandBinding Aby zarejestrować CommandBinding do klasy, w przeciwieństwie do wystąpienia.Use RegisterClassCommandBinding to register a CommandBinding to a class as opposed to an instance.
Użyj, RegisterClassInputBinding Aby zarejestrować InputBinding do klasy, a nie do wystąpienia.Use RegisterClassInputBinding to register an InputBinding to a class as opposed to an instance.
InvalidateRequerySuggestedMetoda wymusza wygenerowanie CommandManager RequerySuggested zdarzenia.The InvalidateRequerySuggested method forces the CommandManager to raise the RequerySuggested event. RequerySuggestedZdarzenie informuje źródło polecenia, aby wykonać zapytanie o polecenie, z którym jest skojarzone, aby określić, czy można wykonać polecenie.The RequerySuggested event informs a command source to query the command it is associated with to determine whether or not the command can execute.
Pola
CanExecuteEvent |
Identyfikuje CanExecute dołączone zdarzenie.Identifies the CanExecute attached event. |
ExecutedEvent |
Identyfikuje Executed dołączone zdarzenie.Identifies the Executed attached event. |
PreviewCanExecuteEvent |
Identyfikuje PreviewCanExecute dołączone zdarzenie.Identifies the PreviewCanExecute attached event. |
PreviewExecutedEvent |
Identyfikuje PreviewExecuted dołączone zdarzenie.Identifies the PreviewExecuted attached event. |
Metody
AddCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) |
Dołącza określony CanExecuteRoutedEventHandler do określonego elementu.Attaches the specified CanExecuteRoutedEventHandler to the specified element. |
AddExecutedHandler(UIElement, ExecutedRoutedEventHandler) |
Dołącza określony ExecutedRoutedEventHandler do określonego elementu.Attaches the specified ExecutedRoutedEventHandler to the specified element. |
AddPreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) |
Dołącza określony CanExecuteRoutedEventHandler do określonego elementu.Attaches the specified CanExecuteRoutedEventHandler to the specified element. |
AddPreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) |
Dołącza określony ExecutedRoutedEventHandler do określonego elementu.Attaches the specified ExecutedRoutedEventHandler to the specified element. |
Equals(Object) |
Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.Determines whether the specified object is equal to the current object. (Odziedziczone po Object) |
GetHashCode() |
Służy jako domyślna funkcja skrótu.Serves as the default hash function. (Odziedziczone po Object) |
GetType() |
Pobiera Type bieżące wystąpienie.Gets the Type of the current instance. (Odziedziczone po Object) |
InvalidateRequerySuggested() |
Wymusza wygenerowanie CommandManager RequerySuggested zdarzenia.Forces the CommandManager to raise the RequerySuggested event. |
MemberwiseClone() |
Tworzy skróconą kopię bieżącego elementu Object .Creates a shallow copy of the current Object. (Odziedziczone po Object) |
RegisterClassCommandBinding(Type, CommandBinding) |
Rejestruje obiekt CommandBinding o określonym typie.Registers a CommandBinding with the specified type. |
RegisterClassInputBinding(Type, InputBinding) |
Rejestruje określony InputBinding Typ z określonym typem.Registers the specified InputBinding with the specified type. |
RemoveCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) |
Odłącza określony CanExecuteRoutedEventHandler od określonego elementu.Detaches the specified CanExecuteRoutedEventHandler from the specified element. |
RemoveExecutedHandler(UIElement, ExecutedRoutedEventHandler) |
Odłącza określony ExecutedRoutedEventHandler od określonego elementu.Detaches the specified ExecutedRoutedEventHandler from the specified element. |
RemovePreviewCanExecuteHandler(UIElement, CanExecuteRoutedEventHandler) |
Odłącza określony CanExecuteRoutedEventHandler od określonego elementu.Detaches the specified CanExecuteRoutedEventHandler from the specified element. |
RemovePreviewExecutedHandler(UIElement, ExecutedRoutedEventHandler) |
Odłącza określony ExecutedRoutedEventHandler od określonego elementu.Detaches the specified ExecutedRoutedEventHandler from the specified element. |
ToString() |
Zwraca ciąg reprezentujący bieżący obiekt.Returns a string that represents the current object. (Odziedziczone po Object) |
Zdarzenia
RequerySuggested |
Występuje, gdy CommandManager wykryje warunki, które mogą zmienić zdolność polecenia do wykonania.Occurs when the CommandManager detects conditions that might change the ability of a command to execute. |
Zdarzenia dołączone
CanExecute |
Występuje, gdy CanExecute(Object, IInputElement) Metoda RoutedCommand jest wywoływana i PreviewCanExecute zdarzenie nie zostało obsłużone.Occurs when the CanExecute(Object, IInputElement) method on the RoutedCommand is called and the PreviewCanExecute event was not handled. |
Executed |
Występuje, gdy Execute(Object, IInputElement) Metoda RoutedCommand jest wywoływana i PreviewExecuted zdarzenie nie zostało obsłużone.Occurs when the Execute(Object, IInputElement) method on the RoutedCommand is called and the PreviewExecuted event was not handled. |
PreviewCanExecute |
Występuje, gdy CanExecute(Object, IInputElement) Metoda RoutedCommand jest wywoływana.Occurs when the CanExecute(Object, IInputElement) method on the RoutedCommand is called. |
PreviewExecuted |
Występuje, gdy Execute(Object, IInputElement) Metoda RoutedCommand jest wywoływana.Occurs when the Execute(Object, IInputElement) method on the RoutedCommand is called. |