wpf中的样式和触发器

时间:2011-06-22 18:08:46

标签: 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.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>

Member.xaml具有以下内容:

<TextBox  Height="23" Name="textBox1" Width="188" Padding="0" Margin="2" />
<TextBox Height="23" Name="textBox2" Width="183" Margin="2" HorizontalAlignment="Left" />

StackPanel内的Grid内。但是当我将鼠标放在控件上时,它不会改变样式。我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

我假设您的目标是.NET 4,如果是这样,此功能为removed