HtmlHost (Silverlight Only) > Task-Based Help > Displaying HTML Markup |
HtmlHost for Silverlight supports displaying HTML markup. You set the C1HtmlHost.SourceHtml property to HTML markup that will be translated at run time; for example see the steps below.
At Design Time
To set the C1HtmlHost.SourceHtml property, complete the following steps:
In XAML
For example, to set the C1HtmlHost.SourceHtml property add SourceHtml to the <c1:C1HtmlHost> tag so that it appears similar to the following:
XAML |
Copy Code
|
---|---|
<c1ext:C1HtmlHost Name="c1HtmlHost1" SourceHtml="This is <b>HTML</b> hosted in a Browser!"/> |
In Code
For example, to set the C1HtmlHost.SourceHtml property, add the following code to your project:
Visual Basic |
Copy Code
|
---|---|
Me.C1HtmlHost1.SourceHtml="This is <b>HTML</b> hosted in a Browser!"
|
C# |
Copy Code
|
---|---|
this.C1HtmlHost1.SourceHtml="This is <b>HTML</b> hosted in a Browser!"; |
What You've Accomplished
The C1HtmlHost control will now display HTML text at run time. Note that in the markup above the "<" and ">" were used for the "<" and ">" symbols. So, for example a tag to make the text bold, which would normally appear like "<b>" is written as "<b>".