如何在WPF XAML模板中将文本放入圆形中?
有几种方法可以做到这一点,例如在在WPF形状上居中文本。
这是一个示例:
<Border CornerRadius="50"
Width="60"
Height="60"
Margin="10"
Padding="0,20,0,0"
Background="Aquamarine"
BorderBrush="Black"
BorderThickness="1">
<TextBlock HorizontalAlignment="Center">Test
</TextBlock>
</Border>