如何在Silverlight文本块中显示简单的HTML? [英] How to display simple HTML in a Silverlight textblock?
问题描述
我有一个HTML标签(B,I,A)的数据源,需要在Silverlight ListBox中显示。
I've got a source of data that has HTML tags in it (B, I, A) and need to display this in a Silverlight ListBox.
搜索它似乎是一个问题,但大多数帖子都是旧的,似乎与Silverlight 1有关。
Searching around it seems to be an issue but most of the posts are old and have to do with Silverlight 1 it seems.
目前用Silverlight显示简单HTML的最好方法是什么?如果没有别的,只需要B,I和A标签用于粗体,斜体和超链接?
What is currently the best way to display simple HTML with Silverlight, if nothing else, just the B, I and A tags for bold, italic and hyperlinks?
推荐答案
Silverlight 2.0中没有本机支持。但是,有人已经创建了 HtmlTextBlock
控件,该控件应该适合您的目的。查看作者的 block post on the subject。还有一个演示页面 here 。
There's no native support in Silverlight 2.0. However, someone has gone and created a HtmlTextBlock
control which should be suitable for your purposes. Check out the author's block post on the subject. There's also a demo page here.
这篇关于如何在Silverlight文本块中显示简单的HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!