欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp.net 臨時數(shù)據(jù)保存實現(xiàn)代碼

 更新時間:2012年04月07日 10:48:40   作者:  
在一個程序運行的時候往往我們會回到上一個頁面,或者我們會需要當時留在這個頁面的臨時數(shù)據(jù),例如,我們用百度搜索“腳本”之后我們會看到很多那啥我就不再說了啊!然后我們返回本來頁面在文本框內會有“腳本”的字樣,我們一下代碼段就是實現(xiàn)這個功能
如果你感覺有用的話拷
走的時候順便頂一下!
復制代碼 代碼如下:

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

相關文章

最新評論