Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to animate a Window?

With WPF, how do I animate the position of a Window. I tried to simply animate the Left/Top properties, but it didn't work. Does anybody know how?

Thanks!

like image 802
Martin Avatar asked Apr 16 '09 04:04

Martin


1 Answers

This will do fade effect while window is showing up:

<Window.Triggers>
    <EventTrigger RoutedEvent="Loaded">
        <BeginStoryboard>
            <Storyboard Duration="00:00:3" Storyboard.TargetProperty="Opacity">
                <DoubleAnimation From="0" To="1"/>
            </Storyboard>
        </BeginStoryboard>
    </EventTrigger>
</Window.Triggers>
like image 107
Nalan Madheswaran Avatar answered Sep 28 '22 08:09

Nalan Madheswaran