如何在 windows phone 中显示 HTML 内容? [英] How to display HTML content in windows phone?

查看:27
本文介绍了如何在 windows phone 中显示 HTML 内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的应用程序中显示我的 html 内容.如何使用 htmltextblock?请帮助我 frnd..我坚持了一个星期解决这个问题...我的 xml 文档描述标签有 html 内容如何将该标签绑定到我的应用程序

how to display my html content in my application.how to use htmltextblock? please help me frnd..i stucked with one week for this problem...my xml document description tag has html content how to bind that tag to my application

推荐答案

您可能可以使用 WebBrowser 控件来显示此内容.从后面的代码中显示此控件中字符串数据的示例如下...

You could probably make use of a WebBrowser control to show this content. An example of showing data from a string in this control from code behind would be as follows...

webBrowser1.NavigateToString("<html><body><h1>Description</h1><p>This is a description, set from code</p></body></html>");

我很想对自己在 HTML 中使用无效标记投反对票,但这似乎有点苛刻,不是吗?;)

I am tempted to downvote myself for using invalid markup in the HTML, but that seems a bit harsh, doesn't it? ;)

无论如何,如果您想绑定到模型的属性,您将不得不做一些额外的工作来设置绑定.这篇博文很好地解释了如何添加可用于绑定到模型中的 HTML 字符串的依赖项属性.

Anyway, if you want to bind to a property of a model, you will have to do some extra work to set the bindings. This blog post does a good job of explaining how to add a dependency property that you may use to bind to HTML strings in your models.

这篇关于如何在 windows phone 中显示 HTML 内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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