Recognize when is the app first launched WP8

送分小仙女□ 提交于 2019-11-30 20:44:11

问题


Does anybody know how can I recognize when is the app first launched? I need to show message dialog only at the first start after install. Thanks...


回答1:


You can use IsolatedStorageSettings and check for a flag.

  var settings = IsolatedStorageSettings.ApplicationSettings;
  if (!settings.Contains("WasLaunched")) {
    MessageBox.Show("First time to launch");
    settings.Add("WasLaunched", true);
  }

Note that re-deploying your app will reset the flag since its just a file saved in Isolated Storage but this should work if you launch your app from within emulator/actual device.



来源:https://stackoverflow.com/questions/16508968/recognize-when-is-the-app-first-launched-wp8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!