开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜