WP 8.1 中挂起时页面数据保存方式(1)
2024-10-02 01:55:13
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();
}
}
最新文章
- GreenPlum高效去除表重复数据
- 【Python】使用正则表达式实现计算器练习
- Git学习笔记(Mac Linux系统)
- 第五章GPIO接口
- hdu 4000Fruit Ninja 树状数组
- 修改linux运行级别
- Microsecond and Millisecond C# Timer[转]
- DEV界面皮肤
- (转)IOS内存管理 retain release
- PAT 1069. The Black Hole of Numbers (20)
- 网络编程之TCP异步群聊:客户端代码
- C# Dictionary.Add(key,value) 与 Dictionary[key]=value的区别
- uva 408 Uniform Generator
- 授权给指定用户,使用navicat在其他ip都可以连接linux服务器上的mysql库
- Mac系统中各个文件夹简单介绍(转)
- VS2017 Cordova 出现错误 @ionic/app-scripts 未安装
- EXE转JPG后缀格式工具(真实JPG后缀)
- HDU [P1533]
- python利用jieba进行中文分词去停用词
- [HNOI 2009]最小圈
热门文章
- 【t034】Matrix67的派对
- [Angular] @ViewChild and template #refs to get Element Ref
- [Angular] Difference between Providers and ViewProviders
- iOS中打电话、打开网址、发邮件、发短信等
- gen_server笔记
- WPF入门(三)->;几何图形之不规则图形(PathGeometry)
- View的绘制顺序
- mingw qt(可以去掉mingwm10.dll、libgcc_s_dw2-1.dll、libstdc++-6.dll的依赖,mingw默认都是动态链接gcc的库而TDM是静态链接gcc库,tdm版本更好用。用aspack压缩没有问题。qt本身不使用异常处理)good
- 【a302】&&【9306】贮油点问题
- GIT 单个文件还原到历史版本号