开发者

WP7 : How to do some treatment during splash screen, but before the first page is open?

开发者 https://www.devze.com 2023-01-16 12:11 出处:网络
In a Windows Phone 7 application, I need to do some treatment befo开发者_开发问答re the first page gets opened.

In a Windows Phone 7 application, I need to do some treatment befo开发者_开发问答re the first page gets opened.

But I'd like to do it during the splash screen, so the user knows the application is effectively running.

I tried several events :

  • Application.Launching event is fired before splash screen
  • Frame.Navigated event is fired after the first page is loaded

Is there any way to do something between those 2 events ?


Perhaps using the technique outlined in this blog post ? http://blogs.msdn.com/b/priozersk/archive/2010/08/17/creating-a-splash-screen-with-a-progress-bar-for-wp7-applications.aspx


The Windows Phone 7 application execution model allows you to perform various operations when the application is loading (as you mentioned - before the actual splash screen) and after the application is loaded (add activated and deactivated to that list as well). You cannot insert specific processes between application loading and loading completion - only on initialization and after it.

For more information, I'd recommend reading:

Understanding the Windows Phone Application Execution Model, Tombstoning, Launcher and Choosers, and Few More Things That Are on the Way – Part 1

Going further, it is not recommended to perform time and resource-consuming operations while the application is launching. According to MSDN:

Applications should not load state data from Isolated Storage in the handler for this event. Because this event is raised before the application is visible or active, performing time consuming tasks, like accessing Isolated Storage can provide a bad user experience as the application will take a long time to load. Instead, calls to Isolated Storage and network resources should be performed asynchronously after the application has loaded.

It is not a restriction, but rather a recommendation that helps providing a better user experience. Therefore, you should carefully plan what you want to do on application startup.

0

精彩评论

暂无评论...
验证码 换一张
取 消