识别应用程序何时首次启动 WP8 [英] Recognize when is the app first launched WP8

查看:31
本文介绍了识别应用程序何时首次启动 WP8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道我如何识别应用程序何时首次启动?我只需要在安装后第一次启动时显示消息对话框.谢谢...

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...

推荐答案

您可以使用 IsolatedStorageSettings 并检查标志.

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.

这篇关于识别应用程序何时首次启动 WP8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆