tags:

views:

64

answers:

4

Hi,

I am using animations with my window to slide out or slide back up. But when these animations are not used. I would like to use Window.Top to set the position of the window, but I think due to animations I cannot set the top. I was wondering if anyone knows how to fix this? Thanks

example.

window.top is already = 33. but when is ay window.top =900; it will stay at 33.

A: 

Try setting FillBehavior="Stop" in your animation.

mdm20
A: 

FillBehavior didn't work. Thanks though.

Kevin
Dont use a new answer to comment on another answer. Use comments instead.
Wallstreet Programmer
A: 

In many cases you can call a Storyboard's Remove method to reset the value source from an animation back to the original source, in this case your explicit value. If you could post some code it would be easier to get a more definitive answer.

John Bowen
A: 

Manual value changes are ignored while an animation is running. You need to remove the animation from the property entirely to make the manually-set values visible.

If you started your animation with a BeginStoryboard action, use a RemoveStoryboard action to remove it:

<RemoveStoryboard BeginStoryboardName="NameOfStoryboard" />

If you applied your animation in code or otherwise, the trick is to pass "null" into the BeginAnimation method to remove it:

window.BeginAnimation(Window.TopProperty, null);
Ray Burns