wpf中的样式和触发器

wpf中的样式和触发器,wpf,triggers,styles,Wpf,Triggers,Styles,App.xaml包含以下内容: <Application x:Class="KiramUI.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="Member.xaml"> <Application.Res

App.xaml包含以下内容:

<Application x:Class="KiramUI.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         StartupUri="Member.xaml">
<Application.Resources>
    <Style TargetType="{x:Type TextBox}">
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BitmapEffect">
                    <Setter.Value>
                        <OuterGlowBitmapEffect GlowColor="Gold" GlowSize="10"></OuterGlowBitmapEffect>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
</Application.Resources>
<TextBox  Height="23" Name="textBox1" Width="188" Padding="0" Margin="2" />
<TextBox Height="23" Name="textBox2" Width="183" Margin="2" HorizontalAlignment="Left" />

并且Member.xaml具有以下功能:

<Application x:Class="KiramUI.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         StartupUri="Member.xaml">
<Application.Resources>
    <Style TargetType="{x:Type TextBox}">
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BitmapEffect">
                    <Setter.Value>
                        <OuterGlowBitmapEffect GlowColor="Gold" GlowSize="10"></OuterGlowBitmapEffect>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
</Application.Resources>
<TextBox  Height="23" Name="textBox1" Width="188" Padding="0" Margin="2" />
<TextBox Height="23" Name="textBox2" Width="183" Margin="2" HorizontalAlignment="Left" />


堆叠面板内
网格内
。但当我将鼠标放在控件上时,它不会改变样式。我遗漏了什么吗?

我假设你的目标是.NET 4,如果这个功能是这样的话。

@Dave Clemer:请远离wpf前缀标记,如果你打算建议你可以做更多的编辑,比如修复代码缩进移得太右…@HB可以,并且将使用样式而不是wpf样式。试图纠正编码样式标签的误用。