Using the Run and LineBreak Objects
In XAML, whitespace is interpreted in the same way as in XML. Whitespace is collapsed, leading and trailing whitespace is removed, and multiple lines are placed on the same line. The LineBreak
class represents an explicit new line in a TextBlock
. To create a multiline TextBlock
, use the LineBreak
element within the content, as shown:
<TextBlock Style="{StaticResource LabelTextStyle}"> You are reading<LineBreak /> Windows Phone 8 Unleashed!</TextBlock>
Note
The XML-like format of XAML does not allow you to use the greater than > or less than < symbols within XAML. This is because the symbols are interpreted as being part of an element. Instead, use the character entity references: ...
Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.