CommandBinding.PreviewCanExecute 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当与此 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时,如果命令目标具有CommandBinding命令目标,则会PreviewCanExecute在命令目标上引发该事件。 然后调用该CommandBinding处理程序CanExecute。 如果命令目标没有 CommandBinding 该命令,则事件会 CanExecute 向上弹出元素树,搜索与 CommandBinding 该命令关联的元素。 如果未处理事件,则会引发该 CanExecute 事件。
路由事件信息
| 物品 | 价值 |
|---|---|
| 标识符字段 | PreviewCanExecuteEvent |
| 路由策略 | 隧道 |
| 代理 | CanExecuteRoutedEventHandler |
- 相应的冒泡事件是 CanExecute。