(转)简单实现UCWeb的新特性展示

来源:互联网 发布:大数据挖掘培训可靠不 编辑:程序博客网 时间:2024/05/22 06:04

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


如图所示,第一次加载会展示新特性.
以后直接转到主页面.
很简单.上代码.

  1. /// <summary>
  2.     /// 应用主页面
  3.     /// </summary>
  4.     public partial class MainPage : PhoneApplicationPage
  5.     {
  6.         // 构造函数
  7.         public MainPage()
  8.         {
  9.             InitializeComponent();
  10.             
  11.         }
  12.         protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
  13.         {
  14.              
  15.              if (WPHelper.IsFirstStart())
  16.             {//如果是第一次加载,跳到特性展示页面.
  17.                 NavigationService.Navigate(new Uri("/NewFeaturesShow/PanoramaPage1.xaml", UriKind.Relative));
  18.             }
  19.         }
  20.     }
复制代码
  1.     public class WPHelper
  2.     {
  3.         /// <summary>
  4.         /// 是否第一次启动
  5.         /// </summary>
  6.         /// <returns>true 为第一次启动</returns>
  7.         public static bool IsFirstStart()
  8.         {
  9.             IsolatedStorageSettings userSetting = IsolatedStorageSettings.ApplicationSettings;
  10.             try
  11.             {
  12.                 string isFirstStart = userSetting["isFirstStart"] as string;
  13.                 if (isFirstStart == "1")
  14.                 {
  15.                     return true;
  16.                 }
  17.                 else
  18.                 {
  19.                     return false;
  20.                 }
  21.             }
  22.             catch (System.Collections.Generic.KeyNotFoundException)
  23.             {
  24.                 userSetting.Add("isFirstStart", "0");
  25.                 return true;
  26.             }



  27.         }

  28.     }
复制代码
这里xaml里用的是Panorama而不是Pivot.
Pivot在滑动的时候会出现一个图片与图片之间的空白区域,如果背景是黑色.显得很突兀.

原文链接http://www.codewp7.com/forum.php?mod=viewthread&tid=801

原创粉丝点击