Silverlight 3: Using Built-in Behaviors and Triggers to Reduce Code

With the addition of Behaviors in Silverlight 3 we have the opportunity to reduce a lot of the code we write in order to create interactivity within our application. Expressions Blend 3 comes with several built-in behaviors right at your fingertips. You can find them in the Assets panel (left side) under the Behaviors group.

  • ChangePropertyAction
  • ControlStoryboardAction
  • FluidMoveBehavior
  • GoToStateAction
  • HyperlinkAction
  • MouseDragElementBehavior
  • PlaySoundAction
  • RemoveElementAction

In this example we will be building a simplistic sound playing app using the ChangePropertyAction as well as the PlaySoundAction Behaviors. By utilizing these 2 built-in Behaviors we can completely eliminate writing a single line of code.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s