FocusManager.GettingFocus 이벤트

정의

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

// Register
static event_token GettingFocus(EventHandler<GettingFocusEventArgs> const& handler) const;

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

// Revoke with event_revoker
static FocusManager::GettingFocus_revoker GettingFocus(auto_revoke_t, EventHandler<GettingFocusEventArgs> const& handler) const;
public static event System.EventHandler<GettingFocusEventArgs> GettingFocus;
function onGettingFocus(eventArgs) { /* Your code */ }
Windows.UI.Xaml.Input.FocusManager.addEventListener("gettingfocus", onGettingFocus);
Windows.UI.Xaml.Input.FocusManager.removeEventListener("gettingfocus", onGettingFocus);
- or -
Windows.UI.Xaml.Input.FocusManager.ongettingfocus = onGettingFocus;
Public Shared Custom Event GettingFocus As EventHandler(Of GettingFocusEventArgs) 

이벤트 유형

Windows 요구 사항

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

설명

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

FocusNavigationDirection.PreviousFocusNavigationDirection.NextFindNextElementOptions와 함께 사용할 수 없습니다. FocusNavigationDirection.Up, FocusNavigationDirection.Down, FocusNavigationDirection.Left 또는 FocusNavigationDirection.Right만 유효합니다.

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

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

적용 대상

추가 정보