windows phone 墓碑化(9)
using System; using System.Collections.Generic;using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
//
using Microsoft.Phone.Shell;
namespace Tombstoned
{
public partial class MainPage : PhoneApplicationPage
{
int sum = 0;
App ap = (App)Application.Current;
// 构造函数
public MainPage()
{
InitializeComponent();
}
//经验证此方法只有在程序启动的时候才加载
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
{
//this.ApplicationTitle.Text = ap.appKey;
}
protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
{
sum++;
//程序标题处显示
this.PageTitle.Text = sum.ToString();
ap.appKey = this.PageTitle.Text;
base.OnManipulationStarted(e);
}
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
if (!string.IsNullOrEmpty(ap.appKey))
{
this.PageTitle.Text = ap.appKey;
}
base.OnNavigatedTo(e);
}
}
}
页:
[1]