Welcome to MSDN Blogs Sign in | Join | Help

My take on simple HTML display in Silverlight [HtmlTextBlock sample updated for Silverlight 2 RTW!]

A couple of readers have asked about an update to my long-running HtmlTextBlock sample for Silverlight 2 RTW. (Background reading: HtmlTextBlock Announcement for the Alpha, Improvements, Beta 1 Update, Data Binding Support, Beta 2 Update) One person went so far as to migrate it himself after emailing me! :) He said the process went well, and I spent a bit of time on the bus ride home doing the migration myself to understand what was involved.

HtmlTextBlock Demonstration

I've updated the HtmlTextBlock demonstration page and the source code download, so you can try things out in your browser and/or download the code to see how it works!

Notes:

  • The only change to the Beta 2 code was to handle the fact that the type of the object returned by HtmlDocument.GetElementsByTagName is now a base class of the HtmlElement instance the code was expecting. After a simple application of the as operator, the code compiles and works like before!

That's it!

Gee, I wish everything went this smoothly... :)

Published Tuesday, November 11, 2008 10:08 PM by Delay
Filed under:

Comments

# My take on simple HTML display in Silverlight [HtmlTextBlock sample updated for Silverlight 2 RTW!] | Tmao Coders

# re: My take on simple HTML display in Silverlight [HtmlTextBlock sample updated for Silverlight 2 RTW!]

Wednesday, November 12, 2008 5:30 AM by wisemx

Thanks.

I hadn't considered something like this but it should work well above/below a Silverlight video.

# Matt - Automotive Software

Wednesday, November 12, 2008 9:08 AM by sporty81

This is a great idea. We really need a way to display HTML in Silverlight. I saw someone else do it by displaying a HTML DIV/IFRAME over the silverlight object.

# A fix for simple HTML display in Silverlight [HtmlTextBlock bug fix for Silverlight 2 RTW!]

Wednesday, November 12, 2008 6:44 PM by Microsoft Weblogs

I updated my HtmlTextBlock sample for RTW last night and got an email from kind reader Ed Silverton this

Anonymous comments are disabled
 
Page view tracker