UIElement.PreviewKeyUp UIElement.PreviewKeyUp UIElement.PreviewKeyUp UIElement.PreviewKeyUp Event

定义

当焦点在该元素上时松开某个键后发生。Occurs when a key is released while focus is 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 

实现

注解

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

适用于