1.保存到Applicaion Data配置信息中:

保存:

privatevoid testTB_TextChanged(object sender, TextChangedEventArgs e)
{
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
localSettings.Values["value"] = testTB.Text;
}

读取:

privatevoid NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
{
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
if (localSettings.Values.ContainsKey("value"))
{
testTB.Text = localSettings.Values["value"].ToString();
}
}

2.放到页面状态中保存

保存:

privatevoid NavigationHelper_SaveState(object sender, SaveStateEventArgs e)
{
e.PageState["value"] = testTB.Text;
}

读取:

privatevoid NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
{
if (e.PageState != null && e.PageState.ContainsKey("value"))
{
testTB.Text = e.PageState["value"].ToString();
}
}

最新文章

  1. GreenPlum高效去除表重复数据
  2. 【Python】使用正则表达式实现计算器练习
  3. Git学习笔记(Mac Linux系统)
  4. 第五章GPIO接口
  5. hdu 4000Fruit Ninja 树状数组
  6. 修改linux运行级别
  7. Microsecond and Millisecond C# Timer[转]
  8. DEV界面皮肤
  9. (转)IOS内存管理 retain release
  10. PAT 1069. The Black Hole of Numbers (20)
  11. 网络编程之TCP异步群聊:客户端代码
  12. C# Dictionary.Add(key,value) 与 Dictionary[key]=value的区别
  13. uva 408 Uniform Generator
  14. 授权给指定用户,使用navicat在其他ip都可以连接linux服务器上的mysql库
  15. Mac系统中各个文件夹简单介绍(转)
  16. VS2017 Cordova 出现错误 @ionic/app-scripts 未安装
  17. EXE转JPG后缀格式工具(真实JPG后缀)
  18. HDU [P1533]
  19. python利用jieba进行中文分词去停用词
  20. [HNOI 2009]最小圈

热门文章

  1. 【t034】Matrix67的派对
  2. [Angular] @ViewChild and template #refs to get Element Ref
  3. [Angular] Difference between Providers and ViewProviders
  4. iOS中打电话、打开网址、发邮件、发短信等
  5. gen_server笔记
  6. WPF入门(三)->几何图形之不规则图形(PathGeometry)
  7. View的绘制顺序
  8. mingw qt(可以去掉mingwm10.dll、libgcc_s_dw2-1.dll、libstdc++-6.dll的依赖,mingw默认都是动态链接gcc的库而TDM是静态链接gcc库,tdm版本更好用。用aspack压缩没有问题。qt本身不使用异常处理)good
  9. 【a302】&&【9306】贮油点问题
  10. GIT 单个文件还原到历史版本号