I define a style in app.xaml:
<Style x:Key="textBoxCenter" TargetType="{x:Type TextBox}">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
I use the style in window1.xaml:
<TextBox
Style="{StaticResource textBoxCenter}"
Background="BlanchedAlmond" Text="BobbleHead" />
<TextBox
Style="{StaticResource textBoxCenter}"
Background="AliceBlue" Text="WhammyBar" />
However, the horizontal alignment, both in the Designer and at runtime, is ‘Left’, even though the Properties toolbar says it is ‘Center’.