<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      HorizontalAlignment="Center" VerticalAlignment="Center">

<!-- Example 16-9. Enter and exit actions -->

<Ellipse Fill="Green" Width="20" Height="100">
  <Ellipse.Triggers>
    <EventTrigger RoutedEvent="Ellipse.MouseEnter">
      <BeginStoryboard Name="enterAnim">
        <Storyboard>
          <DoubleAnimation By="400" Duration="0:0:4"
              Storyboard.TargetProperty="Width" />
        </Storyboard>
      </BeginStoryboard>
    </EventTrigger>
    <EventTrigger RoutedEvent="Ellipse.MouseLeave">
      <BeginStoryboard HandoffBehavior="Compose" Name="leaveAnim">
        <Storyboard>
          <DoubleAnimation By="-400" Duration="0:0:4"
              Storyboard.TargetProperty="Width" />
        </Storyboard>
      </BeginStoryboard>
    </EventTrigger>
    <EventTrigger RoutedEvent="Ellipse.Unloaded">
      <RemoveStoryboard BeginStoryboardName="enterAnim" />
      <RemoveStoryboard BeginStoryboardName="leaveAnim" />
    </EventTrigger>
  </Ellipse.Triggers>
</Ellipse>

<!-- End of Example 16-9. -->

</Page>
