Text formatting in TextBlock
TextBlock Text can be bound to multiple data sources, with StringFormat can be easily displayed.
1 <TextBlockText="{Binding text,stringformat=name:{0}}"/>2 <TextBlockFontSize= "+"textwrapping= "Wrap">3 <Textblock.text>4 <multibindingStringFormat= "name:& #x0a; {0}& #x0a;& #x0a; age:& #x0a; {1}& #x0a;& #x0a; grade:& #x0a; {2}">5 <BindingPath= "Name"/>6 <BindingPath= "Age"/>7 <BindingPath= "Grade"/>8 </multibinding>9 </Textblock.text>Ten </TextBlock>Special characters in XAML
\a & #x07; BEL
\b & #x08; Bs-backspace
\f & #x0c; Ff-formfeed
\ n & #x0a; LF, Nl-linefeed, New Line
\ R & #x0d; Cr-carriage return
\ t & #x09; Ht-tab, Horizontal Tabelator
\v & #x0b; Vt-vertical Tabelator
If you set both the Converter and StringFormat properties, the converter is applied to the data values before the StringFormat is applied.
This article references: http://www.cnblogs.com/xiwang/archive/2013/05/26/3100009.html
Using StringFormat in WPF Binding