新手问题 - 如何将本地数据加载到Win8 Metro风格的网格应用程序模板中 [英] Newbie question - how to load local data into the Win8 Metro style grid application template

查看:60
本文介绍了新手问题 - 如何将本地数据加载到Win8 Metro风格的网格应用程序模板中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一般的发展新手,所以我很感激帮助。 我正在尝试使用VS中提供的模板构建网格应用程序,只是添加我自己的内容而不是占位符内容。 在data / data.js文件中,项目内容有一个变量
,其中包含一些HTML:



var



itemContent =
"< p> Curabitur class aliquam vestibulum nam curae ...< / p>";


我想在项目详细信息页面中使用的HTML内容包含多个段落,因此将其直接剪切并粘贴到data.js文件中非常麻烦,如模板中所示。 此外,VS只允许所有HTML
内容使用一行,因此编辑非常麻烦,因为我必须水平滚动很长时间。


我想提取将HTML内容输出到我的项目中的单独文件中,然后从itemContent变量中调用它。 我该怎么做? 我应该使用文本或XML文件吗? 


非常感谢任何帮助。 


解决方案

Robby,


有很多方法可以实现这一目标。 您可以使用readtext和writetext:

http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/d3865033-8da6-427f-895a-67abe983762a


- 杰夫


I am new to development in general so I appreciate the help.  I am trying to build a grid application using the template provided in VS and simply adding my own content instead of the placeholder content.  In the data/data.js file, there is a variable for item content which contains some HTML:

var

itemContent = "<p>Curabitur class aliquam vestibulum nam curae...</p>";

The HTML content I want to use in the item details pages contains multiple paragraphs, so it is very cumbersome to cut and paste that directly into data.js file, as is shown in the template.  Also, VS only allows one line for all that HTML content so its really a pain to edit because I have to horizontally scroll for a very long time.

I want to extract out the HTML content into a separate file within my project and then call it from the itemContent variable.  How do I do that?  Should I use a text or XML file instead? 

Any help much appreciated. 

解决方案

Robby,

There are many ways to accomplish this.  You could use readtext and writetext: http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/d3865033-8da6-427f-895a-67abe983762a

-Jeff


这篇关于新手问题 - 如何将本地数据加载到Win8 Metro风格的网格应用程序模板中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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