다음을 통해 공유


CoreApplication.BackgroundActivated 이벤트

정의

백그라운드 트리거에 의해 앱이 활성화될 때 발생합니다.

// Register
static event_token BackgroundActivated(EventHandler<BackgroundActivatedEventArgs> const& handler) const;

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

// Revoke with event_revoker
static CoreApplication::BackgroundActivated_revoker BackgroundActivated(auto_revoke_t, EventHandler<BackgroundActivatedEventArgs> const& handler) const;
public static event System.EventHandler<BackgroundActivatedEventArgs> BackgroundActivated;
function onBackgroundActivated(eventArgs) { /* Your code */ }
Windows.ApplicationModel.Core.CoreApplication.addEventListener("backgroundactivated", onBackgroundActivated);
Windows.ApplicationModel.Core.CoreApplication.removeEventListener("backgroundactivated", onBackgroundActivated);
- or -
Windows.ApplicationModel.Core.CoreApplication.onbackgroundactivated = onBackgroundActivated;
Public Shared Custom Event BackgroundActivated As EventHandler(Of BackgroundActivatedEventArgs) 

이벤트 유형

Windows 요구 사항

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

설명

BackgroundTaskBuilder에 백그라운드 트리거를 등록하지만 TaskEntryPoint를 설정하지 마세요. 이렇게 하면 트리거가 신호를 받을 때 이 이벤트가 실행될 수 있습니다. 이벤트 처리기에는 IBackgroundTask.Run 메서드가 제공하는 모든 항목이 포함된 BackgroundActivatedEventArgs 매개 변수가 있습니다.

앱이 백그라운드 상태가 될 때까지 해당 UI는 표시되지 않습니다.

적용 대상

추가 정보