Keyboard.PreviewGotKeyboardFocus Keyboard.PreviewGotKeyboardFocus Keyboard.PreviewGotKeyboardFocus Attached Event

定義

當項目正在取得鍵盤焦點的處理序中發生。Occurs when an element is in the process of acquiring keyboard focus.

see AddPreviewGotKeyboardFocusHandler, and RemovePreviewGotKeyboardFocusHandler
see AddPreviewGotKeyboardFocusHandler, and RemovePreviewGotKeyboardFocusHandler
see AddPreviewGotKeyboardFocusHandler, and RemovePreviewGotKeyboardFocusHandler

備註

這是附加的事件。This is an attached event. WPFWPF 將附加的事件實作為路由事件。implements attached events as routed events. 附加的事件基本上都XAMLXAML參考可以處理不會定義事件的物件的事件的語言概念的WPFWPF展開時也能周遊路由事件。Attached events are fundamentally a XAMLXAML language concept for referencing events that can be handled on objects that do not define that event, which WPFWPF expands upon by also enabling the event to traverse a route. 附加的事件並沒有直接處理語法在程式碼若要附加的程式碼中的路由事件處理常式,您會使用指定的新增 * 處理常式方法。Attached events do not have a direct handling syntax in code; to attach handlers for a routed event in code, you use a designated Add*Handler method. 如需詳細資訊,請參閱 < 附加事件概觀For details, see Attached Events Overview.

如果PreviewGotKeyboardFocus事件或PreviewLostKeyboardFocus處理事件、 鍵盤焦點不會變更。If the PreviewGotKeyboardFocus event or the PreviewLostKeyboardFocus event is handled, keyboard focus does not change.

鍵盤焦點是指接收鍵盤輸入的物件。Keyboard focus refers to the object that is receiving keyboard input. 具有鍵盤焦點的項目具有IsKeyboardFocused設定為trueThe element with keyboard focus has IsKeyboardFocused set to true. 可以有鍵盤焦點設在整個桌面只能有一個項目。There can be only one element with keyboard focus on the entire desktop. 邏輯焦點是指具有焦點的焦點範圍內的物件。Logical focus refers to the object within a focus scope that has focus. 如需有關焦點、 鍵盤焦點和邏輯焦點的詳細資訊,請參閱輸入概觀焦點概觀For more information on focus, keyboard focus, and logical focus, see Input Overview and Focus Overview.

路由事件資訊Routed Event Information

識別項欄位Identifier field PreviewGotKeyboardFocusEvent
路由策略Routing strategy 通道Tunneling
Delegate - 委派Delegate KeyboardFocusChangedEventHandler

適用於