Compartilhar via


Reuse interpolation values on other keyframes

This page applies to WPF and Silverlight 2

In Microsoft Expression Blend 2, you can convert an existing key spline interpolation value to a resource, and then reuse the interpolation value by applying it to other keyframes. This is helpful if you create an interpolation effect that would be difficult to reproduce by hand on other keyframes.

Note

If you modify a keyframe that uses a key spline resource, or add a keyframe to a timeline that has keyframes that use a key spline resource, the keyframes will be converted to local values. If this happens, a notification appears at the top of the artboard.

Convert an interpolation value to a resource

  1. Create a key spline interpolation value on a keyframe using the "To change keyframe interpolation by using the key spline editor" procedure under Change animation interpolation between keyframes.

  2. Under Objects and Timeline, select the keyframe Cc304468.80da70bb-e635-42e8-b26d-f90453096e21(en-us,Expression.10).png that uses the interpolation value that you want to reuse.

  3. In the Properties panel, under Easing, click the Advanced property options Cc304468.d6ba8f4a-b8a2-445a-af0b-a267dfade6e1(en-us,Expression.10).png marker next to the KeySpline property, and then select Convert to New Resource from the pop-up menu.

    Cc304468.bf09a70c-69b3-49cc-8cb1-3fd9698c0774(en-us,Expression.10).png

    The Create KeySpline Resource dialog box appears.

    Cc304468.b2a5ab78-c40a-4093-87c8-be53624a52af(en-us,Expression.10).png

  4. Under Name (Key), type a name for your key spline resource. This is the name by which other elements can reference the resource, thereby applying the resource to themselves.

  5. Under Define in, select the option where you want the key spline brush resource to be defined:

    • To make the resource available to any document in your application, select Application.

    • To make the resource available only to the current document, select This document (Window: Window).

    • To make the resource available only to the object from which you created the resource or its child objects, select This document (object).

    • To define the resource in a resource dictionary file that you can reuse in other projects, select an existing Resource dictionary, or click the New button to create a new resource dictionary.

  6. Click OK to close the dialog box and create the resource. A color-coded frame appears around the KeySpline graph in the Properties panel indicating that the property is now using a resource.

Apply an interpolation resource to another keyframe

  1. With a storyboard open in Expression Blend 2, select a keyframe Cc304468.80da70bb-e635-42e8-b26d-f90453096e21(en-us,Expression.10).png under Objects and Timeline.

  2. In the Properties panel, under Easing, click the Advanced property options Cc304468.d6ba8f4a-b8a2-445a-af0b-a267dfade6e1(en-us,Expression.10).png marker next to the KeySpline property, click Local Resource, and then select the name of the key spline resource that you want to apply to this keyframe.

Modify an interpolation resource

  1. In the Resources panel, expand the node where you defined your key spline resource. For example, if you defined the resource in This document (Window: Window), expand the Window node in the Resources panel.

  2. Locate the key spline resource by name, and then click the modify resource Cc304468.ba0832ff-0583-4262-9063-a4e009e4f813(en-us,Expression.10).png button. A key spline editor appears.

    After you finish modifying the key spline resource, click anywhere outside the key spline editor to close the editor. All of the keyframes that use this key spline resource are automatically updated to use the new key spline value.

See also

Concepts

Change animation interpolation between keyframes