asp.Net一時データ保存実装コード
866 ワード
役に立つと感じたら拷問
行くついでに登って!
作者:MasterMeng
行くついでに登って!
public MainPage()
{
InitializeComponent();
}
PhoneApplicationService phoneAppService = PhoneApplicationService.Current;
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
phoneAppService.State["myValue"] = textBox1.Text;
base.OnNavigatedFrom(e);
}
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
object someObject;
if (phoneAppService.State.ContainsKey("myValue"))
{
if (phoneAppService.State.TryGetValue("myValue", out someObject))
{
textBox1.Text = someObject.ToString();
}
}
base.OnNavigatedTo(e);
}
作者:MasterMeng