Styling a bound string?
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}" />开发者_Python百科
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 TextBlock
to do so, but the RichTextBox
. A TextBlock
can only have one styling. The RichTextBox
is 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
精彩评论