开发者

Styles and triggers in wpf

开发者 https://www.devze.com 2023-03-14 22:15 出处:网络
App.xaml contains the following: <Application x:Class=\"KiramUI.App\" xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"

App.xaml contains the following:

<Application x:Class="KiramUI.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     开发者_JAVA百科    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>

And the Member.xaml has the following:

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

inside a StackPanel inside a Grid. But it does not change the style when I put mouse over the control. Am I missing anything ?


I'm assuming you are targeting .NET 4, if so this feature was removed.

0

精彩评论

暂无评论...
验证码 换一张
取 消