Possible Duplicate:
How to display simple HTML in a Silverlight textblock?
I've got a silverlight 4.0 app running with C# & a SQL Server back end.
The Sql Server DB is populated via another process that includes saving html content (primarily links & p tags, but occasionally other, more complicated HTML).
I've got a telerik license, but their RadHtmlPlaceholder sits on top of everything, and part of this content is a lightbox-style popup that displays youtube videos & flickr images, so I can't go that route.
I'm using a list box template to display a list of 20 tweets, for example. Inside many tweets, HTML content has been saved to my db. I want to display this content & render the HTML (so instead of <a href="www.mysite.com">link</a>
, it displays as link). My bindings currently are set up as:
<TextBlock Padding="10,0,10,0" LineHei开发者_JS百科ght="16" Grid.Row="0" Grid.Column="1" FontSize="11" TextWrapping="Wrap">
<Span FontWeight="Bold" Foreground="#0A5582"><Run Text="{Binding PostTitle}" />:</Span>
<Run Text="{Binding PostContent}" />
</TextBlock>
I'm baffled that I can't do this natively. What are my options?
Ended up using the HTMLTextBlock defined here
Updated version here
精彩评论