3

我想从右到左的过渡样式显示除主页外的所有窗口。

我试过这个

<Window.Triggers>
    <EventTrigger RoutedEvent="Window.Loaded">
        <BeginStoryboard>
            <!--<Storyboard>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:2" FillBehavior="HoldEnd" />
            </Storyboard>-->

            <Storyboard >
                <ThicknessAnimation Duration="0:0:.8" Storyboard.TargetProperty="Margin" To="-1200,0,-100,0" AccelerationRatio=".1"/>
            </Storyboard>
        </BeginStoryboard>
    </EventTrigger>
</Window.Triggers>

如果我把 stackpanel 触发器放在窗口内,它也是从左到右的。

同样明智的是,我需要显示窗口本身。

如何做到这一点?

4

1 回答 1

13

DoubleAnimation财产上的一个Left应该做的伎俩

<Window.Triggers>
    <EventTrigger RoutedEvent="Window.Loaded">
        <BeginStoryboard>
            <Storyboard >
                <DoubleAnimation Duration="0:0:.8" Storyboard.TargetProperty="Left" From="1920" To="0" AccelerationRatio=".1"/>
            </Storyboard>
        </BeginStoryboard>
    </EventTrigger>
</Window.Triggers>
于 2013-04-09T10:34:25.440 回答