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

  <Button Width="20" Height="20">
    <Button.Triggers>
      <EventTrigger RoutedEvent="Rectangle.Loaded">
        <BeginStoryboard>
          <Storyboard>

<!-- Example 16-28. Setting enumeration values with discrete animations -->

<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Button.Visibility)">
  <DiscreteObjectKeyFrame KeyTime="0:0:1.5">
    <DiscreteObjectKeyFrame.Value>
      <Visibility>Hidden</Visibility>
    </DiscreteObjectKeyFrame.Value>
  </DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>

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


          </Storyboard>
        </BeginStoryboard>
      </EventTrigger>
    </Button.Triggers>
  </Button>

</Page>

