我正在编写一个 Windows Phone 8 应用程序。
我刚刚意识到,每次我切换到应用程序(无论是第一次还是在我点击 HOME 然后点击应用程序磁贴返回)时,都会调用 Application_Launching() 。另一方面,Application_Activated() 永远不会被调用。
想知道我是否做错了什么。
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
Log.AppLaunch();
}
// Code to execute when the application is activated (brought to foreground)
// This code will not execute when the application is first launched
private void Application_Activated(object sender, ActivatedEventArgs e)
{
Log.AppActive();
}