Most of the MSDN WinJS app samples I’ve seen call WinJS.UI.processAll() after the app’s activated event. I’ve also seen a number of non-MSDN tutorials that call WinJS.UI.processAll() after the DOMContentLoaded event.
Is there any practical reason to use one approach over the other?
It’s a question of timing; personally I call it on DOMContentLoaded:
One of the primary reasons is that you can return the promise to the activation handler (the
setPromisecall you see in the templates), so that the splash screen is held a little longer until theWinJS.UI.processAllcompletes. This enables a better transition from splashscreen to completed content, without seeing partially constructed UI.However, if you have UI that changes based on the activation type, you may want to delay this until you’ve constructed the DOM anyway. Since you need the activation type to make those differences, you’ll need to call it after the activation event is raised.