UIElement.LosingFocus 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
// Register
event_token LosingFocus(TypedEventHandler<UIElement, LosingFocusEventArgs const&> const& handler) const;
// Revoke with event_token
void LosingFocus(event_token const* cookie) const;
// Revoke with event_revoker
UIElement::LosingFocus_revoker LosingFocus(auto_revoke_t, TypedEventHandler<UIElement, LosingFocusEventArgs const&> const& handler) const;
public event TypedEventHandler<UIElement,LosingFocusEventArgs> LosingFocus;
function onLosingFocus(eventArgs) { /* Your code */ }
uIElement.addEventListener("losingfocus", onLosingFocus);
uIElement.removeEventListener("losingfocus", onLosingFocus);
- or -
uIElement.onlosingfocus = onLosingFocus;
Public Custom Event LosingFocus As TypedEventHandler(Of UIElement, LosingFocusEventArgs)
<uiElement LosingFocus="eventhandler"/>
事件類型
備註
我們建議盡可能使用 UIElement 的焦點路由事件,而非 FocusManager 事件。
一次只能對一個 UI 元素進行聚焦。
當另一個控制項被聚焦、應用程式視圖改變、使用者切換應用程式,或使用者與系統互動導致該應用程式不再處於前景時,控制項可能會失去焦點。
在程式化地在元素間切換時, FocusNavigationDirection.Prior 和 FocusNavigationDirection.Next 無法與 FindNextElements Options 一起使用。 只有 FocusNavigationDirection.Up、 FocusNavigationDirection.Down、 FocusNavigationDirection.Left 或 FocusNavigationDirection.Right 是有效的。
LosingFocus 是一個被淘汰的事件。 欲了解更多路由事件概念,請參閱 事件與路由事件總覽。