开发者

Animation on TabItem creation?

Is it possible to animate a TabItem when it's created ? I would like to create an 开发者_如何转开发animation which will slide the TabItem from the bottom of my window to the TabControl itself and add some fade in effect too :)


Short answer: yes. You can associate an animation with the Loaded routed event as shown below.

<TabItem>
    <TabItem.Triggers>
        <EventTrigger RoutedEvent="Loaded">
            <BeginStoryboard>
                    <Storyboard>
                        <!-- animations go here -->
                    </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </TabItem.Triggers>
</TabItem>

You can then put any animation you want in the Storyboard to give the desired effect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜