<Window.Triggers>
<EventTrigger RoutedEvent="Button.Click" SourceName="yxkBt">
<BeginStoryboard>
<Storyboard>
<ThicknessAnimation To="0,0,0,0" Duration="0:0:0.3"
Storyboard.TargetName="btList2"
Storyboard.TargetProperty="Margin"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Window.Triggers>
<Button Margin="5,5,5,5" Height="60" FontSize="26" x:Name="yxkBt">开始动画</Button>
btList2:是菜单列表,是给btList2做动画效果,让他的margin属性移动到0,0,0,0,耗时三秒
yxkBt:是菜单按钮,是触发动画的地方