다음을 통해 공유


WebUIApplication.Suspending 이벤트

정의

앱이 일시 중단되면 발생합니다.

public:
 static event SuspendingEventHandler ^ Suspending;
// Register
static event_token Suspending(SuspendingEventHandler const& handler) const;

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

// Revoke with event_revoker
static WebUIApplication::Suspending_revoker Suspending(auto_revoke_t, SuspendingEventHandler const& handler) const;
public static event SuspendingEventHandler Suspending;
function onSuspending(eventArgs) { /* Your code */ }
Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", onSuspending);
Windows.UI.WebUI.WebUIApplication.removeEventListener("suspending", onSuspending);
- or -
Windows.UI.WebUI.WebUIApplication.onsuspending = onSuspending;
Public Shared Custom Event Suspending As SuspendingEventHandler 

이벤트 유형

설명

사용자가 다른 앱 또는 데스크톱으로 전환할 때마다 시스템에서 앱을 일시 중단합니다. 사용자가 다시 돌아올 때마다 시스템에서 앱을 다시 시작합니다. 시스템에서 앱을 다시 시작할 때, 변수와 데이터 구조의 콘텐츠는 시스템에서 앱을 일시 중단하기 전과 동일합니다. 앱은 중단되었던 곳에서 정확히 복원되므로, 사용자에게는 앱이 배경에서 실행되고 있었던 것처럼 보입니다.

앱이 일시 중단된 동안 시스템은 앱과 데이터를 메모리에 유지하려고 합니다. 그러나 시스템에 앱을 메모리에 유지할 리소스가 없는 경우 시스템은 앱을 종료합니다. 사용자가 종료된 일시 중단된 앱으로 다시 전환하면 앱은 활성화된 이벤트를 수신하고 세션 상태 개체가 정의되었는지 여부를 검사 합니다. 개체가 정의되면 앱에서 해당 데이터를 로드해야 합니다.

시스템은 앱 종료 시 앱에 알리지 않으므로, 앱은 일시 중단될 때 애플리케이션 데이터를 저장하고 단독 리소스와 파일 핸들을 해제하며 앱이 종료 후 활성화될 때 이 리소스와 파일 핸들을 복원해야 합니다.

또한 앱이 일시 중단된 동안 다른 앱에서 사용할 수 있도록 일시 중단 시 파일 핸들과 같은 배타적 리소스를 해제해야 합니다. 앱은 Oncheckpoint 이벤트를 수신 대기하여 일시 중단되는 앱을 처리할 수도 있습니다.

참고

앱이 일시 중단될 때 비동기 작업을 수행해야 하는 경우 작업이 완료될 때까지 일시 중단 완료를 연기해야 합니다. suspendingOperation.getDeferral 메서드를 사용하여 지연을 완료할 때까지 일시 중단 완료를 지연할 수 있습니다.

적용 대상

추가 정보