Keyboard.PreviewKeyDown 附加事件
定义
当按下键盘上的某个键时发生。Occurs when a key on the keyboard is pressed.
see AddPreviewKeyDownHandler, and RemovePreviewKeyDownHandler
see AddPreviewKeyDownHandler, and RemovePreviewKeyDownHandler
see AddPreviewKeyDownHandler, and RemovePreviewKeyDownHandler
注解
这是一个附加事件。This is an attached event. WPF 将附加事件作为路由事件实现。WPF implements attached events as routed events. 附加事件本质上是一个 XAML 语言概念,用于引用可以在未定义该事件的对象上处理的事件,WPF 通过同时启用该事件来遍历路由。Attached events are fundamentally a XAML language concept for referencing events that can be handled on objects that do not define that event, which WPF expands upon by also enabling the event to traverse a route. 附加事件在代码中没有直接处理语法;若要在代码中附加路由事件的处理程序,请使用指定的 Add * 处理程序方法。Attached events do not have a direct handling syntax in code; to attach handlers for a routed event in code, you use a designated Add*Handler method. 有关详细信息,请参阅 附加事件概述。For details, see Attached Events Overview.
路由事件信息Routed Event Information
标识符字段Identifier field | PreviewKeyDownEvent |
路由策略Routing strategy | 隧道Tunneling |
委托Delegate | KeyEventHandler |