lpx

Hi,


I have made a storyboard to fade out an object.

But the fade in i want to do it manually.

So i do something like headline.Opacity = 100;

But nothing happens!

Does storyboards block properties

Thx,

Nuno


Re: Windows Presentation Foundation (WPF) Does storyboards block properties?

Florian Krüsch

Hi Nuno,

the FillBehavior of a storyboard is set to "HoldEnd" by default and that's what it does.

You can set it to Manual instead, but you need to handle the Completed event in this case and set the end value of the property, because it will snap back to the value it had before the animation in case you don't.

cheers

Florian






Re: Windows Presentation Foundation (WPF) Does storyboards block properties?

Steve Galic - MSFT

If you only have a single animation in your storyboard, and are doing things in code, you can simply call beginAnimation on your animation rather than setting up a storyboard just for one. You can also easily replace the final value within something like

...

Code Block

someAnimation.Completed += delegate

{

yourObject.yourDP = someAnimation.To;

yourObject.BeginAnimation(yourObject.yourDPProperty,null);

}

yourObject.BeginAnimation(yourObject.yourDPProperty, someAnimation)