UIElement.PreviewKeyUp 事件

定義

焦點在這個項目上方且放開按鍵時發生。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 

事件類型

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 會為這個類別建立附加事件的別名,因此 PreviewKeyUpUIElement 繼承為基底專案時,它就是類別成員清單的一部分。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.

適用於