Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So frustrated.

Why does this work:
XML
<window.resources>
        
            <Setter Property="Effect">
                <Setter.Value>
                    <DropShadowEffect ShadowDepth="10" />
                </setter.Value>
            </setter>

But this does nothing:
XML
<window.resources>
        
            <Style.Triggers>
                <EventTrigger RoutedEvent="MouseEnter">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation From="0" To="10" Duration="00:00:01" Storyboard.TargetProperty="(DropShadowEffect.ShadowDepth)"/>
                            </storyboard>
                        </beginstoryboard>
                    </eventtrigger.Actions>
                </eventtrigger>
             </style.Triggers>

In other words, I can make a shadow appear statically, but when I animate the same property, no shadow appears when the mouse enters?

Thanks all for taking a peek. This has to be something simple that I am missing.

What I have tried:

I have already tried replacing
XML
Storyboard.TargetProperty="(DropShadowEffect.ShadowDepth)"/>
with
XML
Storyboard.TargetProperty="(Button.Effect).(DropShadowEffect.ShadowDepth)"/>
but this throws a runtime exception.
Posted
Updated 27-May-20 2:28am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900