如何查找每个Windows.Storage.ApplicationData.Current.LocalSettings对象,其键中包含一些不属于整个键的字母 [英] how to find every Windows.Storage.ApplicationData.Current.LocalSettings object with some letters in its key which aren't part of the entire key

查看:53
本文介绍了如何查找每个Windows.Storage.ApplicationData.Current.LocalSettings对象,其键中包含一些不属于整个键的字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名Windows Phone 7开发人员,为Windows 8构建了一个都市风格的应用程序,而我的应用程序主要是一个家庭作业计划程序。为了在我的地铁风格的应用程序中保存新的作业,我将作业保存为
Windows.Storage.ApplicationDataCompositeValue
下的键["] ;作业" +作业任务名称]。

I'm a Windows Phone 7 developer building a metro style app for windows 8 and my app is a homework planner primarily. To save a new homework in my metro style app I save the homework as a Windows.Storage.ApplicationDataCompositeValue under the key ["Homework" + The homework task name].

我想用"家庭作业"填充每个设置值的列表。在它的关键是什么是最好的方式来做到这一点?在Windows手机中我会使用foreach语句,但我不知道你会在下面的括号中放入什么来找到我想要的东西?

I want to populate a list of every settings value with "Homework" in its key what would be the best way to do this? In windows phone I would use a foreach statement but I don't know what you would put in the following brackets to find what I want?

我很灵活,如果有更好的方法可以保存家庭作业信息我想要的东西可以让你把作业保存为对象有3个字符串和1个日期时间属性,我最初尝试创建自己的类
并将其保存到设置中但是它没有正确序列化但是如果这是最好的方法,你可以解释如何序列化这将是辉煌的

I am flexible as to how I save the homework information if there is a better way to do it all I want is something which allows you to save the homework as an object with 3 strings and 1 datetime properties, I originally tried to make my own class and save that into settings however it didn't serialize properly but if that's the best way to do it and you can explain how to serialize it that would be brilliant

非常感谢任何帮助这是我的应用程序中非常重要的一部分:)

Huge thanks for any help this is a really important part of my app :)

Dominic Ayre

Dominic Ayre

推荐答案

您可以拥有一个包含您要存储的所有信息的类,包括包含作业任务的列表。

这里有一个示例显示了如何序列化这样一个带有StorageFolder列表的类:

如何序列化具有列表< T>

http:// social .msdn.microsoft.com /论坛/ zh-CN / winappswithcsharp / thread / 46b19d4a-60a6-48d3-875d-1ce00993760d

这里有一个帮助类可能有助于存储东西:

Here you have a helper class that may be of assistance to store stuff:

隔离存储助手对于基于C#和XAML的Metro应用程序

http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/isolated-storage-helper-for-C-Sharp-and-xaml-based -metro-applica /

------------------- -------------------------------------------------- -----------

--------------------------------------------------------------------------------

Alejandro Campos Magencio - Mic rosoft Escalation Engineer - 论坛版主

 如果我的回复回答了您的问题,请将此帖标记为已回答。

Alejandro Campos Magencio - Microsoft Escalation Engineer - Forum Moderator
 If my reply answers your question, please mark this post as answered.


这篇关于如何查找每个Windows.Storage.ApplicationData.Current.LocalSettings对象,其键中包含一些不属于整个键的字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆