ContentElement.PreviewKeyUp 事件

定义

在此元素聚焦于键盘并且松开某个键时发生。Occurs when a key is released while the keyboard is focused on this element.

public:
 virtual event System::Windows::Input::KeyEventHandler ^ PreviewKeyUp;
public event System.Windows.Input.KeyEventHandler PreviewKeyUp;
member this.PreviewKeyUp : System.Windows.Input.KeyEventHandler 
Public Custom Event PreviewKeyUp As KeyEventHandler 

事件类型

KeyEventHandler

实现

注解

键处理与其他平台功能(如命令和文本撰写)交互。Key handling interacts with other platform features such as commanding and text composition. KeyUp事件是较低级别的文本输入事件,可能不会在某些控件上按预期方式工作。The KeyUp event is a lower-level text input event that might not behave as expected on certain controls. 这是因为某些控件具有控件组合或类处理,可提供较高级别的文本输入处理和相关事件。This is because some controls have control compositing or class handling that provides a higher-level version of text input handling and related events. 有关详细信息,请查看各个控件的文档。For details, check the documentation for individual controls.

此事件将为 Keyboard.PreviewKeyUp 此类创建附加事件的别名,因此 PreviewKeyUpContentElement 继承为基元素时,它是类成员列表的一部分。This event creates an alias for the Keyboard.PreviewKeyUp attached event for this class, so that PreviewKeyUp is part of the class members list when ContentElement is inherited as a base element. 附加到事件的事件处理程序 PreviewKeyUp 附加到基础 Keyboard.PreviewKeyUp 附加事件,并接收相同的事件数据实例。Event handlers that are attached to the PreviewKeyUp event are attached to the underlying Keyboard.PreviewKeyUp attached event and receive the same event data instance.

路由事件信息Routed Event Information

标识符字段Identifier field PreviewKeyUpEvent
路由策略Routing strategy 隧道Tunneling
委托Delegate KeyEventHandler
  • 对应的冒泡事件为 KeyUpThe corresponding bubbling event is KeyUp.

  • 重写 OnPreviewKeyUp 以在派生类中实现此事件的类处理。Override OnPreviewKeyUp to implement class handling for this event in derived classes.

适用于