Export (0) Print
Expand All

Add a behavior that was created by someone else

To add interactivity to your application without having to write code, you can drag a behavior from the Assets panel onto an object in your application and then set the properties of the behavior. You can also use behaviors that are created by people in the Microsoft Expression Blend community. For example, you can download custom behaviors from the Microsoft Expression Gallery Ee341397.xtlink_newWindow(en-us,Expression.40).png. If you want to use a behavior that was created by someone else, add a reference to the .dll file or project that contains the behavior. This will make the behavior available in the Assets panel.

NoteNote

Developers can use the new Expression Blend Software Development Kit (SDK) to create custom behaviors. To view the SDK documentation, click Expression Blend SDK User Guide on the Help menu.

To add a behavior that was created by someone else

  1. Add a reference to the .dll file or project that contains the custom behavior.

    NoteNote

    The reference is added to the System.Windows.Interactivity and Microsoft.Expression.Interactions DLLs in the Libraries folder in the SDK. The location depends on whether the reference is added to a Microsoft Silverlight or Windows Presentation Foundation (WPF) project.

    For more information, see the following topics:

  2. Build your project (CTRL+SHIFT+B or F5).

  3. Open the Assets panel to view the custom behavior in the Behaviors category.

    You can now drag the behavior onto objects in your application.

    For more information, see Add a behavior to an object.

To make a custom behavior always show up in the Assets panel

If you download an assembly that contains multiple behaviors that you think you will use frequently, you can register the assembly to make the behaviors available to any project you create without having to add a reference.

  1. Do one of the following:

    • For a behavior that is written for Silverlight, create a registry subkey in \HKEY_CURRENT_USER\Software\Microsoft\Expression\Blend\v4.0\Toolbox\Silverlight\v4.0 that is named the same as the assembly namespace.

    • For a behavior that is written for WPF, create a registry subkey in \HKEY_CURRENT_USER\Software\Microsoft\Expression\Blend\v4.0\Toolbox\WPF\v4.0 that is named the same as the assembly namespace.

  2. In the subkey, create a default string value and set it to the path of your assembly.

tip noteTip

Alternatively, you could copy the assemblies to the corresponding subfolder for Silverlight or WPF:

  • Silverlight   C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries

  • WPF   C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries

See also

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.
Show:
© 2014 Microsoft