Reputation: 3790
I have a Silverlight
project which is embedded in my Webpage.
The silverlight
control must display HTML
content, very basic stuff like
<b> <font> <p> tags
However the Web browser control is only available in an out of browser app which mine isnt.
I looked for HtmlBrush
as other suggested but cant find this control
So how do I add a text content control that can display HTML
content?
UPDATE
I wasnt able to do this with the standard Silverlight restrictions. So what I found was a library that converted HTML,RTF to Silverlight RichText format.
The link I found is here Just in case anyone else could benifit from this.
Upvotes: 2
Views: 4462
Reputation: 222522
You can make use of WebBrowser Control,
XAML:
<Grid x:Name="LayoutRoot" Background="White">
<Border Width="300" Height="200" BorderBrush="#000000" >
<WebBrowser x:Name="webBrowser" />
</Border>
</Grid>
Code Behind:
public MainPage()
{
InitializeComponent();
webBrowser.NavigateToString("<h1>HTML in Silverlight</h1><p>This is some <strong>simple HTML</strong>!</p>");
}
read More here,
For browser inside application,
Not out of browser - HTML inside Silverlight
Upvotes: 3