UIElement.PreviewGotKeyboardFocus 事件

定義

鍵盤以此元素為焦點時發生。

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

事件類型

實作

備註

因為這個事件使用通道路由,所以具有焦點的專案可能是子專案,而不是實際附加事件處理常式的專案。 Source檢查事件資料中的 ,以判斷具有焦點的實際專案。

這個事件會為此 Keyboard.PreviewGotKeyboardFocus 類別建立附加事件的別名,以便在 PreviewGotKeyboardFocus 繼承為基底專案時 UIElement 屬於類別成員清單的一部分。 附加至 PreviewGotKeyboardFocus 事件的事件處理常式會附加至基礎 Keyboard.PreviewGotKeyboardFocus 附加事件,並接收相同的事件資料實例。

路由事件資訊

識別碼欄位 PreviewGotKeyboardFocusEvent
路由策略 隧道
代理人 KeyboardFocusChangedEventHandler

適用於

另請參閱