FocusManager.GotFocus 이벤트

정의

컨테이너 요소 내의 요소(포커스 scope)가 포커스를 받을 때 발생합니다. 이 이벤트는 비동기적으로 발생하므로 버블링이 완료되기 전에 포커스가 이동할 수 있습니다.

// Register
static event_token GotFocus(EventHandler<FocusManagerGotFocusEventArgs> const& handler) const;

// Revoke with event_token
static void GotFocus(event_token const* cookie) const;

// Revoke with event_revoker
static FocusManager::GotFocus_revoker GotFocus(auto_revoke_t, EventHandler<FocusManagerGotFocusEventArgs> const& handler) const;
public static event System.EventHandler<FocusManagerGotFocusEventArgs> GotFocus;
function onGotFocus(eventArgs) { /* Your code */ }
Windows.UI.Xaml.Input.FocusManager.addEventListener("gotfocus", onGotFocus);
Windows.UI.Xaml.Input.FocusManager.removeEventListener("gotfocus", onGotFocus);
- or -
Windows.UI.Xaml.Input.FocusManager.ongotfocus = onGotFocus;
Public Shared Custom Event GotFocus As EventHandler(Of FocusManagerGotFocusEventArgs) 

이벤트 유형

Windows 요구 사항

디바이스 패밀리
Windows 10, version 1809 (10.0.17763.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v7.0에서 도입되었습니다.)

설명

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

UIElement 포커스 이벤트는 다음 순서대로 FocusManager까지 버블업됩니다.

  1. UIElement.LosingFocus/FocusManager.LosingFocus
  2. UIElement.GettingFocus/FocusManager.GettingFocus
  3. UIElement.LostFocus 라우트된 이벤트는 포커스를 잃고 이벤트가 버블업되는 요소에 의해 발생합니다.
  4. FocusManager.LostFocus 가 발생합니다(라우트된 이벤트가 처리된 것으로 표시되어 있더라도).
  5. UIElement.GotFocus 라우트된 이벤트는 포커스를 받은 요소에 의해 발생하며 이벤트가 버블업됩니다.
  6. FocusManager.GotFocus가 발생합니다(라우트된 이벤트가 처리된 것으로 표시되어 있더라도).

적용 대상

추가 정보