Sometimes a simple decoration is required around some element or panel, such as a border. Luckily, the
Border element does just that to anything placed inside it.
Make sure Visual Studio is up and running.
We'll create a simple border encompassing some text, to show most of the capabilities of
MainWindow.xaml. Replace the existing
StackPanel, and add a
TextBlockinside it, like the following markup shows:
<StackPanel Margin="4"> <TextBlock Text="Hello from Center" FontSize="25" HorizontalAlignment="Center" /> </StackPanel>