CommandBinding.PreviewCanExecute 事件

定義

與此 CommandBinding 相關聯的命令開始檢查是否可在目前的命令目標執行該命令時發生。

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 

事件類型

備註

CanExecute呼叫 上的 RoutedCommand 方法時,PreviewCanExecute如果命令目標具有 CommandBinding 命令的 ,就會在命令目標上引發 事件。 然後呼叫 CanExecuteCommandBinding 處理程式。 如果命令目標沒有 CommandBinding 命令的 ,事件會 CanExecute 反升元素樹狀結構,以搜尋與 CommandBinding 命令相關聯的專案。 如果未處理事件,則會 CanExecute 引發 事件。

路由事件資訊

標識元欄位 PreviewCanExecuteEvent
路由策略 隧道
代理人 CanExecuteRoutedEventHandler

適用於

另請參閱