<Window x:Class="_5_WPF样式和行为_3设置属性.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Icon="public/003540AH4M72.jpg" Title="_5_WPF样式和行为_3设置属性" Height="450" Width="800">
    <Window.Resources>
        <!-- 使用背景设置 -->
        <Style x:Key="GirlTileElementStyle">
            <Setter Property="Control.Background">
                <Setter.Value>
                    <ImageBrush TileMode="Tile" ViewportUnits="Absolute" Viewport="0 0 32 32"
                                ImageSource="public/003540AH4M72.jpg" />
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 使用文字设置 -->
        <Style x:Key="BigFontButtonStyle">
            <Setter Property="Button.FontFamily" Value="楷体" />
            <Setter Property="Button.FontSize" Value="18" />
            <Setter Property="Button.FontWeight" Value="Bold" />
        </Style>

        <!-- 不用在前面再写 Property="Button.FontFamily" -->
        <Style x:Key="BigFontButtonStyle2" TargetType="Button">
            <Setter Property="FontFamily" Value="楷体" />
            <Setter Property="FontSize" Value="18" />
            <Setter Property="FontWeight" Value="Bold" />
        </Style>
    </Window.Resources>

    <StackPanel>
        <Button Margin="0 10" Padding="15 5" Style="{StaticResource GirlTileElementStyle}">第一个</Button>
        <Button Margin="0 10" Padding="15 5" Style="{StaticResource BigFontButtonStyle}">第二个</Button>
        <Button Margin="0 10" Padding="15 5 " Style="{StaticResource BigFontButtonStyle2}">第三个</Button>
    </StackPanel>
</Window>