这里有一些代码(在app.xaml中)
<Application.Resources> <Style TargetType="Button" x:Key="GelButton" > <Setter Property="Margin" Value="1,2,1,2"/> <Setter Property="HorizontalAlignment" Value="Left"/> </Style> </Application.Resources>
然后,为您的按钮(例如):
<Button Height="50" Width="250" Style="{StaticResource GelButton}" Content="Button 1" /> <Button Height="50" Width="250" Style="{StaticResource GelButton}" Content="Button 2" />
希望这将帮助您找到您要找的东西。