Now open the MainWindow.xaml, and follow these steps to add TextBlock control with various formatting options:
- First, change the pre-existing Grid panel to a StackPanel.
- Now add the following two TextBlock controls to it, which will have plain text in them:
<TextBlock Text="1. This is a TextBlock control, with 'Text'
property" Margin="10 5" /> <TextBlock Margin="10 5"> 2. This is a TextBlock control, having text as Content </TextBlock>
- Add the following XAML to have a few more TextBlock controls, with some basic text formatting applied to them:
<TextBlock Text="3. This is a TextBlock control, having text
formatting" FontWeight="Bold" FontStyle="Italic" TextDecorations="Underline" Foreground="Red" Margin="10 5" /> <TextBlock Text="4. TextBlock with...