October 26th, 2009

Using Behaviors to get things moving in Blend

Silverlight Blend Tutorials, Working with Silverlight, by Gavin Wignall.

This post is part of a string of posts found here: Learn Blend in a Month.

The launch of Silverlight 3 brought with it the introduction of Behaviors. Behaviors are pieces of functionality that can be applied to objects within Expression Blend without the need for knowing any code at all.

Expression Blend has the following Behaviors ready for use:

  • ChangePropertyAction - Change an objects property
  • ControlStoryboardAction - Tell a storyboard to play/pause / stop
  • FluidMoveBehavior - Changes an objects easing
  • GoToStateAction - Changes an objects state
  • HyperlinkAction - Calls a hyperlink
  • MouseDragElementBehavior - Allows an item to be dragged
  • PlaySoundAction - Plays an audio element
  • RemoveElementAction - removes an object from the stage

To apply a Behavior, first click on the last icon in the main tool bar called ‘Assets‘, then drag your chosen Behavior onto the object you want to activate the Behavior.

Once your Behavior has been placed you will see it indented below that object in the ‘Object and Timeline‘ tab. To set the properties, click on the Behavior and go to the ‘Properties‘ tab. You will see two sections, the ‘Trigger‘ section allows you to set the source target and the event trigger type (mouse enter, mouse click etc). The ‘Common Properties‘ section allows you to set what happens when the Behavior is played.

In this previous post we used the ‘ControlStoryboardAction‘ to start an animation off automatically when the page is loaded.

To find additional Behaviors to use check out the Expression Gallery and CodePlex.

Back Top

Responses to “Using Behaviors to get things moving in Blend”

  1. No comments yet.
  1. Learn Expression Blend in a Month! » Silverlight Buzz (,October 27, 2009)

    [...] Using Behaviors to get things moving in Blend [...]

  2. uberVU - social comments (,November 10, 2009)

    Social comments and analytics for this post…

    This post was mentioned on Twitter by SilverlightNews: Using Behaviors to get things moving in Blend – http://tinyurl.com/yg8bbd8...

Leave a Reply

Back Top