<Window x:Class="_5_WPF样式和行为_1样式基础.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"
        xmlns:system="clr-namespace:System;assembly=System.Runtime"
        mc:Ignorable="d"
        Icon="public/003540AH4M72.jpg" Title="_5_WPF样式和行为_1样式基础" Height="450" Width="800">
    <Window.Resources>
        <FontFamily x:Key="ButtonFontFamily">楷体</FontFamily>
        <system:Double x:Key="ButtonFontSize">18</system:Double>
        <FontWeight x:Key="ButtonFontWeight">Bold</FontWeight>

        <Style x:Key="BigFontButtonStyle">
            <Setter Property="Control.FontFamily" Value="Times New Roman" />
            <Setter Property="Control.FontSize" Value="18" />
            <Setter Property="Control.FontWeight" Value="Bold" />
        </Style>
    </Window.Resources>
    <StackPanel>
        <Button Padding="5" Margin="5" Name="Cmd" FontFamily="{StaticResource ButtonFontFamily}"
                FontWeight="{StaticResource ButtonFontWeight}"
                FontSize="{StaticResource ButtonFontSize}">
            手动设置
        </Button>

        <Button Padding="5" Margin="5" Name="BunnyButton" Style="{StaticResource BigFontButtonStyle}">使用写好的样式</Button>

        <Button Padding="5" Margin="5" Name="MyButton" Click="MyButton_OnClick">使用代码设置</Button>
    </StackPanel>
</Window>