Very often, it is necessary to show some labels on the page. Such a task can be accomplished using the TextBlock
control, which is the main subject of this recipe. Here, you will learn how to display static text on the page as well as how to format it.
To add a text block and handle the Tapped
event, perform the following steps:
Place the
TextBlock
control on the page and adjust its appearance by modifying the content of theMainPage.xaml
file as follows:<Page (...)> <Grid (...)> <TextBlock Text="Exemplary justified content (...)" TextAlignment="Justify" MaxLines="3" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" LineHeight="30" ...