CommandBinding.PreviewCanExecute Event

Definition

Si verifica quando il comando associato a CommandBinding avvia un controllo per determinare se è possibile eseguire il comando sulla destinazione corrente.Occurs when the command associated with this CommandBinding initiates a check to determine whether the command can be executed on the current command target.

public:
 event System::Windows::Input::CanExecuteRoutedEventHandler ^ PreviewCanExecute;
public event System.Windows.Input.CanExecuteRoutedEventHandler PreviewCanExecute;
member this.PreviewCanExecute : System.Windows.Input.CanExecuteRoutedEventHandler 
Public Custom Event PreviewCanExecute As CanExecuteRoutedEventHandler 
Public Event PreviewCanExecute As CanExecuteRoutedEventHandler 

Remarks

Quando viene chiamato il metodo CanExecute su un RoutedCommand, il PreviewCanExecute evento viene generato sulla destinazione del comando se la destinazione del comando ha un CommandBinding per il comando.When the CanExecute method on a RoutedCommand is called, the PreviewCanExecute event is raised on the command target if the command target has a CommandBinding for the command. Viene quindi chiamato il gestore CanExecute per tale CommandBinding.Then the CanExecute handler for that CommandBinding is called. Se la destinazione del comando non dispone di un CommandBinding per il comando, l'evento CanExecute bolle verso l'alto l'albero degli elementi che cerca un elemento con un CommandBinding associato al comando.If the command target does not have a CommandBinding for the command, the CanExecute event bubbles up the element tree searching for an element that has a CommandBinding associated with the command. Se l'evento non viene gestito, viene generato l'evento CanExecute.If the event is not handled, the CanExecute event is raised.

Informazioni evento indirizzatoRouted Event Information

Campo identificatoreIdentifier field PreviewCanExecuteEvent
Strategia di routingRouting strategy TunnelingTunneling
DelegatoDelegate CanExecuteRoutedEventHandler
  • L'evento di bubbling corrispondente viene CanExecute.The corresponding bubbling event is CanExecute.

Applies to

See also