I have a large chunk of customer relevant information that I am storing in an XML file.
Each XML element requires some sort of rich text formatting (bold, italics, new line, paragraphs, etc...). I have complete control over the XML file (i.e. I can wrap the text in other XML elements if required), and it is static (which makes life a bit easier).
What is a good way to store the information in the XML file so that I can load it into my Silverlight page with the correct formatting?
For Example:
I have a string like so:
var str = @"<Run Foreground=""Maroon"" FontFamily=""Courier New"" FontSize=""24"">Courier New 24</Run>";
I cannot just do this:
MyTextBlock.Text = str;
because it prints out literally as the string is defined (no formatting)
However, in XAML, I can define the TextBlock like so:
<TextBlock x:Name="PageDetailsTextBlock">
<Run Foreground="Maroon" FontFamily="Courier New" FontSize="24">Courier New 24</Run>
</TextBlock>
And the XAML parser will convert that into the correctly formatted version.
How can do this in C#?