How do I go about styling a bound string to a TextBlock? I’d like to have some of the text bolded, but not all of it?
<TextBlock Name="lblZoneNumber" Margin="12, 20, 0, 0" TextWrapping="Wrap" Text="{Binding ZoneSummary}" />
A sample of the text would be:
“Your vehicle, test1234, is currently parked in Grand Rapids, MI at zone 100” and I’d like to bold the text like: “Your vehicle, test1234, is currently parked in Grand Rapids, MI at zone 100.”
I can’t really make these textblocks programmatically as the text is part of a view model/pivotitem.
You cannot do this until you start to develop for Mango, and then you would not use the
TextBlockto do so, but theRichTextBox. ATextBlockcan only have one styling. TheRichTextBoxis read only, BTW.Here is a link to info about the
RichTextBox: http://www.windowsphonegeek.com/articles/Windows-Phone-7-Mango-First-look-at-RichTextBox-control