开发者

Silverlight 3: Event trigger argues that attribute is out of range

I want to make a grid non-transparent when mouse enters. So I try to catch MouseEnter event and animate Opactity propert开发者_StackOverflow中文版y

    <Grid  Opacity="0.1" Name="myGrid" >
            <Grid.Triggers>
                <EventTrigger RoutedEvent="Grid.MouseEnter"  >
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation From="0.1" To="1" Duration="00:00:01" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="myGrid"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Grid.Triggers>
    </Grid>

But InitializeComponent argues that Grid.MouseEnter attribute is out of range. What I am doing wrong?


Your code worked here.

I use Visual Studio 2010 and pasted your code in to a C# WPF Application.


You need to specify the event as MouseEnter instead of Grid.MouseEnter

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜