ContentElement.PreviewLostKeyboardFocus 事件


鍵盤不再以此元素為焦點時發生。Occurs when the keyboard is no longer focused on this element.

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



因為此事件使用通道路由,遺失焦點的元素可能是子項目,而不是實際附加事件處理常式的專案。Because this event uses tunneling routing, the element that lost focus might be a child element instead of the element where the event handler is actually attached. 檢查事件資料中的 Source,以判斷遺失焦點的實際元素。Check the Source in the event data to determine the actual element that lost focus.

這個事件會為這個類別建立 Keyboard.PreviewLostKeyboardFocus 附加事件的別名,因此,當 ContentElement 繼承為基底專案時,PreviewLostKeyboardFocus 就是類別成員清單的一部分。This event creates an alias for the Keyboard.PreviewLostKeyboardFocus attached event for this class, so that PreviewLostKeyboardFocus is part of the class members list when ContentElement is inherited as a base element. 附加至 PreviewLostKeyboardFocus 事件的事件處理常式會附加至基礎 Keyboard.PreviewLostKeyboardFocus 附加事件,並接收相同的事件資料實例。Event handlers that are attached to the PreviewLostKeyboardFocus event are attached to the underlying Keyboard.PreviewLostKeyboardFocus attached event and receive the same event data instance.

路由事件資訊Routed Event Information

識別碼欄位Identifier field PreviewLostKeyboardFocusEvent
路由策略Routing strategy 通道Tunneling
委派Delegate KeyboardFocusChangedEventHandler