Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Animating window loading in xaml

$
0
0

I have this xaml:

    <Window.Triggers>
        <EventTrigger RoutedEvent="Window.Loaded">
            <EventTrigger.Actions>
                <BeginStoryboard>                    
                    <Storyboard BeginTime="0">
                        <DoubleAnimation Storyboard.TargetName="me"  Storyboard.TargetProperty="Top" From="0" To="275" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:2" RepeatBehavior="0:0:4" />
                        <DoubleAnimation Storyboard.TargetName="me" Storyboard.TargetProperty="Left" From="0" To="350" AutoReverse="true" BeginTime="0:0:0" Duration="0:0:2" RepeatBehavior="0:0:4" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger.Actions>
        </EventTrigger>
    </Window.Triggers>

which works fine - when the window is loaded it moves down and across the screen and then back. But if I change the TargetProperty values from "Top" to "Height" and "Left" to "Width", absolutely nothing happens. I was hoping that the window would expand and then contract.

Can someone explain what it is I'm not understanding??

Thanks for any suggestions!

Ade


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>