WPF对按钮文本的影响

WPF对按钮文本的影响,wpf,button,effects,Wpf,Button,Effects,我试图在App.xaml中的按钮文本中添加辉光效果,但我找不到有关如何执行此操作的任何信息。我发现的所有效果都应用于“完成”按钮 这是我的密码: <Application x:Class="RSPolar.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/200

我试图在App.xaml中的按钮文本中添加辉光效果,但我找不到有关如何执行此操作的任何信息。我发现的所有效果都应用于“完成”按钮

这是我的密码:

<Application x:Class="RSPolar.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <Style TargetType="Button">
            <Setter Property="FontSize" Value="48">
            </Setter>
            <Setter Property="Foreground" Value="#00EE00">
            </Setter>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush  StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="Gray" Offset="1"/>
                        <GradientStop Color="DarkGray" Offset="0.52"/>
                        <GradientStop Color="Gray" Offset="0.5"/>
                        <GradientStop Color="LightGray" Offset="0.48"/>
                        <GradientStop Color="WhiteSmoke" Offset="0"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Button.Effect">
                <Setter.Value>
                    <DropShadowEffect Color="Black" Direction="320" ShadowDepth="3" BlurRadius="10" Opacity="0.5" />
                </Setter.Value>
            </Setter>
            <Setter Property="Button.Effect">
                <Setter.Value>
                    <BlurEffect Radius="1"></BlurEffect>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
</Application>

尝试添加文本块,使其在按钮中作为内容生效

   <Window.Resources>
    <Style TargetType="Button">
        <Setter Property="FontSize" Value="48">
        </Setter>
        <Setter Property="Foreground" Value="#00EE00">
        </Setter>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush  StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Color="Gray" Offset="1"/>
                    <GradientStop Color="DarkGray" Offset="0.52"/>
                    <GradientStop Color="Gray" Offset="0.5"/>
                    <GradientStop Color="LightGray" Offset="0.48"/>
                    <GradientStop Color="WhiteSmoke" Offset="0"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Button.Effect">
            <Setter.Value>
                <DropShadowEffect Color="Black" Direction="320" ShadowDepth="3" BlurRadius="10" Opacity="0.5" />
            </Setter.Value>
        </Setter>
        <Setter Property="Button.Effect">
            <Setter.Value>
                <BlurEffect Radius="1"></BlurEffect>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>

  <Button Width="300" Height="200">
    <TextBlock Text="Content">
        <TextBlock.Effect>
            <DropShadowEffect BlurRadius="8" Color="#00EE00" ShadowDepth="0"/>
        </TextBlock.Effect>
    </TextBlock>
</Button>

更新

在样式中使用ContentTemplate,您可以将其用于所有按钮

   <Window.Resources>
    <Style TargetType="Button">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock FontSize="48" Foreground="#00EE00" Text="{Binding Path=Content,RelativeSource={RelativeSource AncestorType={x:Type Button}}}">
                        <TextBlock.Effect>
                            <DropShadowEffect BlurRadius="8" Color="#00EE00" ShadowDepth="0"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush  StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Color="Gray" Offset="1"/>
                    <GradientStop Color="DarkGray" Offset="0.52"/>
                    <GradientStop Color="Gray" Offset="0.5"/>
                    <GradientStop Color="LightGray" Offset="0.48"/>
                    <GradientStop Color="WhiteSmoke" Offset="0"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Button.Effect">
            <Setter.Value>
                <DropShadowEffect Color="Black" Direction="320" ShadowDepth="3" BlurRadius="10" Opacity="0.5" />
            </Setter.Value>
        </Setter>
        <Setter Property="Button.Effect">
            <Setter.Value>
                <BlurEffect Radius="1"></BlurEffect>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>
<StackPanel>
    <Button Width="300" Content="content1" Height="200"/>
    <Button Width="300" Content="content2" Margin="0,10,0,0" Height="200"/>
</StackPanel>

如何将其添加为App.xaml中所有按钮的常规样式?