<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Continuing support for simple HTML display in Silverlight [HtmlTextBlock sample updated for Silverlight 2 Beta 1!]</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx</link><description>A few months ago when Silverlight 1.1 Alpha was all the rage, I wrote a sample control that made a best-effort attempt to display simple HTML markup in Silverlight. The original HtmlTextBlock post described the control's purpose and the follow-up post</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Silverlight Cream for March 17, 2008 -- #227</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx#8295870</link><pubDate>Tue, 18 Mar 2008 00:17:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8295870</guid><dc:creator>Community Blogs</dc:creator><description>&lt;p&gt;Brad Abrams posted links the the SL2 poster, Shawn Wildermuth has links out to a discussion of a Cross&lt;/p&gt;
</description></item><item><title>Ressources développeur pour Silverlight 2</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx#8296703</link><pubDate>Tue, 18 Mar 2008 01:05:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8296703</guid><dc:creator>Pierre Lagarde, Blog</dc:creator><description>&lt;p&gt;Depuis la mise a disponibilit&amp;#233; de Silverlight 2 au Mix08 il y a eu beaucoup d'articles, de blogs sur&lt;/p&gt;</description></item><item><title>re: Continuing support for simple HTML display in Silverlight [HtmlTextBlock sample updated for Silverlight 2 Beta 1!]</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx#8304043</link><pubDate>Tue, 18 Mar 2008 06:34:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8304043</guid><dc:creator>eibrahim</dc:creator><description>&lt;p&gt;Thanks for this control, but it is not working for me. &amp;nbsp;I tried to add it to a databound listbox and it wouldn't show up.&lt;/p&gt;
&lt;p&gt;My listbox item temple looks like this:&lt;/p&gt;
&lt;p&gt; &amp;lt;DataTemplate x:Key=&amp;quot;ItemReviewTemplate&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Grid Height=&amp;quot;90&amp;quot; HorizontalAlignment=&amp;quot;Stretch&amp;quot; VerticalAlignment=&amp;quot;Stretch&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Visibility=&amp;quot;Visible&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;StackPanel x:Name=&amp;quot;pnlItemInfo&amp;quot; Width=&amp;quot;Auto&amp;quot; HorizontalAlignment=&amp;quot;Stretch&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;TextBlock x:Name=&amp;quot;txtSummary2&amp;quot; Text=&amp;quot;{Binding Summary}&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HorizontalAlignment=&amp;quot;Stretch&amp;quot; MinWidth=&amp;quot;200&amp;quot;&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;local:HtmlTextBlock x:Name=&amp;quot;txtSummary&amp;quot; Text=&amp;quot;{Binding Summary}&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HorizontalAlignment=&amp;quot;Stretch&amp;quot; MinWidth=&amp;quot;200&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/local:HtmlTextBlock&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;!--&amp;lt;local:HtmlTextBlock x:Name=&amp;quot;txtContent&amp;quot; Text=&amp;quot;{Binding Content}&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextWrapping=&amp;quot;Wrap&amp;quot; HorizontalAlignment=&amp;quot;Stretch&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MinWidth=&amp;quot;200&amp;quot; UseDomAsParser=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/local:HtmlTextBlock&amp;gt;--&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/StackPanel&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Grid&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/DataTemplate&amp;gt;&lt;/p&gt;
</description></item><item><title>re: Continuing support for simple HTML display in Silverlight [HtmlTextBlock sample updated for Silverlight 2 Beta 1!]</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx#8319209</link><pubDate>Tue, 18 Mar 2008 21:13:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8319209</guid><dc:creator>Delay</dc:creator><description>&lt;p&gt;eibrahim,&lt;/p&gt;
&lt;p&gt;This is a consequence of me doing as simple a port as possible. :( Recall that Silverlight 1.1 Alpha did not support data binding, so this issue simply couldn't exist there. Now that Silverlight 2 Beta 1 supports data binding, HtmlTextBlock needs a minor change to support it. In particular, its properties need to be backed by DependencyProperties in order for data binding to work as we'd like. I'll be updating the sample soon to add this support, but for now if you go ahead and replace the Text property definition of the HtmlTextBlock class with the following, then your scenario should work fine:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public static DependencyProperty TextProperty = DependencyProperty.Register(&amp;quot;Text&amp;quot;, typeof(string), typeof(HtmlTextBlock),&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;delegate(DependencyObject o, DependencyPropertyChangedEventArgs e) { ((HtmlTextBlock)o).ParseAndSetText((string)(e.NewValue)); });&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public string Text&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get { return (string)GetValue(TextProperty); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set { SetValue(TextProperty, value); }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;Please let me know if this doesn't solve the problem!&lt;/p&gt;
</description></item><item><title>Code to support new features doesn't write itself [HtmlTextBlock sample gets data binding support!]</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx#8321877</link><pubDate>Tue, 18 Mar 2008 23:33:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8321877</guid><dc:creator>Delay's Blog</dc:creator><description>&lt;p&gt;In the comments to my post about porting the HtmlTextBlock sample to Silverlight 2 Beta 1 , kind reader&lt;/p&gt;
</description></item><item><title>Again with the support for simple HTML display in Silverlight [HtmlTextBlock sample updated for Silverlight 2 Beta 2!]</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx#8591720</link><pubDate>Wed, 11 Jun 2008 20:15:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8591720</guid><dc:creator>Delay's Blog</dc:creator><description>&lt;p&gt;A customer recently asked about an update to my HtmlTextBlock sample for the newly released Silverlight&lt;/p&gt;
</description></item><item><title>My take on simple HTML display in Silverlight [HtmlTextBlock sample updated for Silverlight 2 RTW!]</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx#9061429</link><pubDate>Wed, 12 Nov 2008 09:15:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9061429</guid><dc:creator>Delay's Blog</dc:creator><description>&lt;p&gt;A couple of readers have asked about an update to my long-running HtmlTextBlock sample for Silverlight&lt;/p&gt;
</description></item><item><title>A fix for simple HTML display in Silverlight [HtmlTextBlock bug fix for Silverlight 2 RTW!]</title><link>http://blogs.msdn.com/delay/archive/2008/03/17/continuing-support-for-simple-html-display-in-silverlight-htmltextblock-sample-updated-for-silverlight-2-beta-1.aspx#9064182</link><pubDate>Wed, 12 Nov 2008 23:17:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9064182</guid><dc:creator>Delay's Blog</dc:creator><description>&lt;p&gt;I updated my HtmlTextBlock sample for RTW last night and got an email from kind reader Ed Silverton this&lt;/p&gt;
</description></item></channel></rss>