O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying Text Using the TextBlock

The TextBlock is an essential element in most Windows Phone XAML apps. It represents a section of text and is normally used to label controls or control groups. The TextBlock supports word wrapping, so that long runs of text are not hidden when they exceed the width of the control. The following code shows how to create a TextBlock in XAML, using the built-in PhoneTextNormalStyle:

<TextBlock Text="Windows Phone 8 Unleashed"    Style="{StaticResource PhoneTextNormalStyle}" />

Alternatively, the TextBlock also allows you to nest content within the TextBlock element, like so:

<TextBlock Style="{StaticResource LabelTextStyle}">    Windows Phone 8 Unleashed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required