UIElement.LosingFocus 이벤트

정의

UIElement가 포커스를 잃기 전에 발생합니다. 이 이벤트는 이벤트가 버블링되는 동안 포커스가 이동되지 않도록 동기적으로 발생합니다.

// 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"/>

이벤트 유형

Windows 요구 사항

디바이스 패밀리
Windows 10 Creators Update (10.0.15063.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v4.0에서 도입되었습니다.)

설명

가능하면 FocusManager 이벤트 대신 UIElement 포커스 라우트된 이벤트를 사용하는 것이 좋습니다.

한 번에 하나의 UI 요소만 포커스를 가질 수 있습니다.

컨트롤은 다른 컨트롤이 포커스를 가져오거나, 애플리케이션 보기가 변경되거나, 사용자가 애플리케이션을 전환하거나, 애플리케이션이 더 이상 포그라운드에 있지 않도록 시스템과 상호 작용할 때 포커스를 잃을 수 있습니다.

프로그래밍 방식으로 요소 간을 탐색할 때 FocusNavigationDirection.PreviousFocusNavigationDirection.NextFindNextElementOptions와 함께 사용할 수 없습니다. FocusNavigationDirection.Up, FocusNavigationDirection.Down, FocusNavigationDirection.Left 또는 FocusNavigationDirection.Right만 유효합니다.

LosingFocus는 라우트된 이벤트입니다. 라우트된 이벤트 개념에 대한 자세한 내용은 이벤트 및 라우트된 이벤트 개요를 참조하세요.

적용 대상

추가 정보