This might have been asked before but I’m really looking for a simple way to display a programatically formatted text inside some text container.
For decoupling purposes I would like to use a binding property, this is how I do it now:
<TextBlock Height="219" Name="_txtBox" Text="{Binding myText}" />
and then
myText = "<TextBlock>\n <Run FontWeight=\"Bold\">\n" + item1 + "\n</Run>\n " + item2 + "\n</TextBlock>";
For some unknown WP7 design reasons this does not work, I’ve tried with TextBox also. Is there any way that I can output some small formatted text to any kind control without over-complicating?
I would like to keep binding in place
This should work for you. Although I was not sure where you wanted the line breaks. You can add or remove them from the inlines collection.
XAML
Code