Absolutely centered content inside a WPF layout panel
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid VerticalAlignment="Center"> <StackPanel HorizontalAlignment="Center"> <TextBlock>First</TextBlock> <TextBlock>and the second</TextBlock> </StackPanel> </Grid></Window>
You could also write your own Panel
subclass that does this automatically.