UIElement.PreviewKeyUp Event


当焦点在该元素上时松开某个键后发生。Occurs when a key is released while focus is on this element.

 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 



键处理与其他平台功能(如命令和文本撰写)交互。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 附加事件的别名,以便在将 UIElement 作为基元素继承时,PreviewKeyUp 是类成员列表的一部分。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 UIElement 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.

Applies to