开发者

Animation on TabItem creation?

开发者 https://www.devze.com 2022-12-28 12:46 出处:网络
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

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

精彩评论

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