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.
精彩评论