I have some html documents like this:
<HTML>
<BODY>
<p style="text-align:Left;font-size:20;font-famil开发者_JAVA百科y:Calibri;font-weight:normal;font-style:normal;color:#000000;">
<span>asfsdf</span>
</p>
</BODY>
</HTML>
I'd like to display them in Silverlight 4. They would be some read-only content. Is it possible?
In our Silverlight application we have some ChildWindow. Also, I have a HTML to XAML converter but I don't want to display it after converting.
There are two ways to achieve this, depending on where Silverlight is hosted.
Out-of-browser
You can use the WebBrowser control.In-browser
You can float HTML over the top of your Silverlight control to make it appear as though the content is in your control. You have to setwindowless
totrue
for this to work. This blog has a nice explanation on how to use this approach.
Here I've detailed written about edit and view rich text formats in Silverlight 4. You can implement your own HtmlViewer control, which will work in windowless mode of silverlight or use one of those third party controls. Good luck!
精彩评论