Bringing more HTML to Silverlight [HtmlTextBlock improvements]
**
This blog has moved to a new location and comments have been disabled.
All old posts, new posts, and comments can be found on The blog of dlaa.me.
See you there!
Comments
Anonymous
September 24, 2007
PingBack from http://www.artofbam.com/wordpress/?p=2523Anonymous
September 24, 2007
Inject the HTML into an IFrame in a different security context. This will give you the security you need.Anonymous
September 25, 2007
rbirkby, Thanks very much for the suggestion! If you have a pointer to more information about this approach, I'd love to understand the implications a little better. According to my current understanding, moving to an IFRAME might let me use a different security context, but if I can't also turn off JavaScript entirely then I'm concerned the basic vulnerability still exists - even if it's limited to annoying alert dialogs. On a related note, my concern about searching for "<script>...</script>" and ignoring it is that clever folks might be able to sneak the tags through anyway (ex: "<script >", etc.). I know I could use a Regex to do a pretty good job, but the underlying issue still concerns me. And even if I believed I'd addressed the <script> concern, I'd be worried about something like <img ... onload="..." /> where script runs for an event handler instead. So if you've got a suggestion that lets me disable script entirely, then I'm definitely interested! :)Anonymous
September 25, 2007
The comment has been removedAnonymous
October 09, 2007
Thanks a bunch for this great control! It beings much needed HTML functionality back into Silverlight. Any way to get the links to actually fire? Maybe via a HtmlPage.Navigate() call or something?Anonymous
October 09, 2007
Michael, I explain why links don't navigate in the third "note" of the initial post. Per your suggestion, .Navigate would be a good way to do the navigation - but the difficulty is in detecting the click of the link instead! :) Basically, there doesn't seem to be a good way to detect a click on the link itself at the moment. While it would be possible to detect a click on the HtmlTextBlock, that would only seem to make sense if there were exactly one link present. So for lack of a good way to support this, I chose not to for now. However, if you have a scenario where it makes sense to behave differently, by all means do so! :)Anonymous
October 16, 2007
I think today is the start for great things to come. And why? Because I had my first article publishedAnonymous
March 17, 2008
A few months ago when Silverlight 1.1 Alpha was all the rage, I wrote a sample control that made a best-effortAnonymous
June 11, 2008
A customer recently asked about an update to my HtmlTextBlock sample for the newly released SilverlightAnonymous
November 11, 2008
A couple of readers have asked about an update to my long-running HtmlTextBlock sample for SilverlightAnonymous
November 12, 2008
I updated my HtmlTextBlock sample for RTW last night and got an email from kind reader Ed Silverton this