Control.FocusEngaged 이벤트

정의

컨트롤 경계 내에서 포커스가 제한될 때 발생합니다(게임 패드/원격 상호 작용의 경우).

// Register
event_token FocusEngaged(TypedEventHandler<Control, FocusEngagedEventArgs const&> const& handler) const;

// Revoke with event_token
void FocusEngaged(event_token const* cookie) const;

// Revoke with event_revoker
Control::FocusEngaged_revoker FocusEngaged(auto_revoke_t, TypedEventHandler<Control, FocusEngagedEventArgs const&> const& handler) const;
public event TypedEventHandler<Control,FocusEngagedEventArgs> FocusEngaged;
function onFocusEngaged(eventArgs) { /* Your code */ }
control.addEventListener("focusengaged", onFocusEngaged);
control.removeEventListener("focusengaged", onFocusEngaged);
- or -
control.onfocusengaged = onFocusEngaged;
Public Custom Event FocusEngaged As TypedEventHandler(Of Control, FocusEngagedEventArgs) 
<control FocusEngaged="eventhandler"/>

이벤트 유형

Windows 요구 사항

디바이스 패밀리
Windows 10 Anniversary Edition (10.0.14393.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v3.0에서 도입되었습니다.)

설명

이벤트 데이터는 FocusEngagedEventArgs를 참조하세요.

포커스 참여를 사용하면 게임 패드 또는 리모컨을 사용하여 앱과 상호 작용하는 것이 더 쉬워집니다. 포커스 참여를 설정해도 키보드 또는 기타 입력 장치에는 영향을 주지 않습니다.

IsFocusEngagementEnabled 속성이 true로 설정되면 컨트롤을 포커스 연결이 필요한 것으로 표시합니다. 즉, 사용자가 A/선택 단추를 눌러 컨트롤을 "연결"하고 조작해야 합니다. 작업이 완료되면 B/뒤로 단추를 눌러 컨트롤을 분리하고 해당 컨트롤에서 벗어날 수 있습니다.

이 속성에 대한 자세한 내용은 Xbox 및 TV용 디자인 문서의 포커스 참여 섹션을 참조하세요.

버전 호환성

Windows 10 버전 1607 이전에는 FocusEngaged 이벤트를 사용할 수 없습니다. Microsoft Visual Studio에서 앱의 '최소 플랫폼 버전' 설정이 이 페이지의 뒷부분에 있는 요구 사항 블록에 표시된 '도입된 버전'보다 작은 경우 이를 고려하여 앱을 디자인하고 테스트해야 합니다. 자세한 내용은 버전 적응 코드를 참조하세요.

앱이 이전 버전의 Windows 10 실행되는 경우 예외를 방지하려면 먼저 런타임 검사 수행하지 않고 이 이벤트를 연결하지 마세요. 이 예제에서는 ApiInformation 클래스를 사용하여 사용하기 전에 이 이벤트가 있는지 검사 방법을 보여줍니다.

<Slider x:Name="slider1" Loaded="Slider_Loaded"/>
private void Slider_Loaded(object sender, RoutedEventArgs e)
{
    if (ApiInformation.IsEventPresent("Windows.UI.Xaml.Controls.Control", "FocusEngaged"))
    {
        slider1.FocusEngaged += Slider1_FocusEngaged;
    }
}

적용 대상