作为 WP7开发者开发的应用,能使用户在没有使用就能了解到本应用的特性。

如图所示,第一次加载会展示新特性.
以后直接转到主页面.
很简单.上代码.
- /// <summary>
- /// 应用主页面
- /// </summary>
- public partial class MainPage : PhoneApplicationPage
- {
- // 构造函数
- public MainPage()
- {
- InitializeComponent();
-
- }
- protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
- {
-
- if (WPHelper.IsFirstStart())
- {//如果是第一次加载,跳到特性展示页面.
- NavigationService.Navigate(new Uri("/NewFeaturesShow/PanoramaPage1.xaml", UriKind.Relative));
- }
- }
- }
复制代码
- public class WPHelper
- {
- /// <summary>
- /// 是否第一次启动
- /// </summary>
- /// <returns>true 为第一次启动</returns>
- public static bool IsFirstStart()
- {
- IsolatedStorageSettings userSetting = IsolatedStorageSettings.ApplicationSettings;
- try
- {
- string isFirstStart = userSetting["isFirstStart"] as string;
- if (isFirstStart == "1")
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- catch (System.Collections.Generic.KeyNotFoundException)
- {
- userSetting.Add("isFirstStart", "0");
- return true;
- }
-
-
-
- }
-
- }
复制代码
这里xaml里用的是Panorama而不是Pivot.
Pivot在滑动的时候会出现一个图片与图片之间的空白区域,如果背景是黑色.显得很突兀.
原文链接http://www.codewp7.com/forum.php?mod=viewthread&tid=801