BooleanAnimationUsingKeyFrames::KeyFrames Property

Gets or sets the collection of BooleanKeyFrame objects that define the animation.

Namespace:  System.Windows.Media.Animation
Assembly:  PresentationCore (in PresentationCore.dll)

property BooleanKeyFrameCollection^ KeyFrames {
	BooleanKeyFrameCollection^ get ();
	void set (BooleanKeyFrameCollection^ value);
  <BooleanKeyFrameCollection .../>

Property Value

Type: System.Windows.Media.Animation::BooleanKeyFrameCollection
The collection of BooleanKeyFrame objects that define the animation. The default value is Empty.

This example shows how to animate the Boolean property value of a Button control by using key frames.

The following example uses the BooleanAnimationUsingKeyFrames class to animate the IsEnabled property of a Button control. All the key frames in this example use an instance of the DiscreteBooleanKeyFrame class. Discrete key frames like DiscreteBooleanKeyFrame create sudden jumps between values, that is, the movement of the animation is jerky.

No code example is currently available or this language may not be supported.
<!-- Demonstrates a BooleanAnimationUsingKeyFrames. The animation is used to
     animate the IsEnabled property of a button. -->
  WindowTitle="KeyFrameBoolean Animation Example">

  <StackPanel Orientation="Vertical" Margin="20">

        Click the button to animate its IsEnabled property with a 
        BooleanAnimationUsingKeyFrames animation.

    <Button Name="myAnimatedButton" Margin="200">Click Me
        <EventTrigger RoutedEvent="Button.Click">
                Duration="0:0:4" FillBehavior="HoldEnd">

                <!-- All the key frames below are DiscreteBooleanKeyFrames. Discrete key frames create 
                sudden "jumps" between values (no interpolation). Only discrete key frames can be used 
                for Boolean key frame animations. -->
                <DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:0" />
                <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:1" />
                <DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:2" />
                <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:3" />
                <DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:3.5" />
                <DiscreteBooleanKeyFrame Value="True" KeyTime="0:0:4" />

For the complete sample, see KeyFrame Animation Sample.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft