Windows 8 Development - Application Resume

12 June 2014

While most of the events I described in previous posts had events in both Windows.UI.WebUI.WebUIApplication and WinJS.Application, there is no WinJS wrapper around WinRT event in this situation.

Also, since the framework makes the process of suspend/resume seamless, there are limited reasons for using this event. But, in situations where it is needed, it is good to be aware of it.

1 var app = Windows.UI.WebUI.WebUIApplication;
2 app.addEventListener("resuming", function () {
3     //Do something...
4 }, false);

Some situations you might consider using "onresuming" for are as follows:

  • Clearing the state information that was stored during the "suspending" event.
  • Checking for network connectivity, and synchronizing your data with the cloud.
  • Running any time sensitive operations that should have occurred while the application was suspended.