Monday, July 13, 2009

Expression Blend Samples

We've been working on a set of behaviors and effects for use in Expression Blend 3, beyond the set that are being shipped with the product. These are mostly experimental or 'interesting' ones that can be useful in a variety of different circumstances.

The source code and an installer to have them automatically appear in Blend can be found on the Expression Blend CodePlex site.

Some of the triggers, actions and behaviors which are included:

  • PlayMedia- plays a media element
  • PauseMedia- pauses a media element
  • TogglePlayPauseMedia- toggles between play/pause on a media element
  • StopMedia- stops a media element
  • MouseGestureTrigger- triggers an action when the user makes a gesture on the element.
  • MouseEventTrigger- allows more complex mouse triggers such as double-click or firing from handled events
  • StateChangedTrigger- triggers when the state is changed
  • CallDataMethod- calls a method on the data context
  • InvokeDataCommand- executes a command on the data context
  • DataEventTrigger- triggers when an event is raised on the data context. Useful for doing something such as playing a sound or animation when something happens on the data context
  • SetDataProperty- sets a property on the data context
  • DataStateBehavior- switches between two states depending on the value of a binding
  • FluidBindProperty- acts as a proxy for databound properties in order to animate the changing of the value
  • PropertyChangedTrigger- triggers when the value of the property changes, regardless of the new value
  • ClippingBehavior- Provides a rounded rectangular clipping that scales with the element. Useful since Silverlight and WPF clipping geometries don't scale with objects
  • GoToNextState- Go to the next state in a VisualStateManager. Useful for quickly navigating between various states
  • GoToPreviousState- Go to the previous state in a VisualStateManager. Useful for quickly navigating between various states
  • SetProperty- Similar to ChangePropertyAction but allows incrementing as well as setting
  • ShowMessageBox- Displays a standard message box to the user
  • ListBoxAddOne- Action which duplicates a random item in the ItemsSource collection of a ListBox. Useful for SketchFlow prototypes where you want to show adding a new item
  • ListBoxRemoveOne- Action which removes a random item in the ItemsSource collection of a ListBox. Useful for SketchFlow prototypes to simulate removing an item.
  • ListBoxRemoveThisItem- Action for use inside of a ListBoxItem which will remove the item from the data collection of the owning ListBox.

The source code for the project also includes quite a bit of design-time work and might be useful as a reference if anyone is wondering how to take advantage of some of Blend's extensibility features for behaviors and effects.

1 Comments:

Anonymous Anonymous said...

Hi, i'm new to the expression blend world..and
I am having a trouble with installing(?) the behaviors downloaded from CodePlex at http://expressionblend.codeplex.com/
,the installing version.

What I try to do is getting all the sample behaviors, such as MouseGestureTrigger, in asset library window of blend 3 so that i can use it for my own project

I've installed the sample at the default directory({program files}\Microsoft Expression\Blend 3 Samples)

and run the 'blend 3' but couldn't get the behaviors from the asset>behaviors' list.

How can I get those great behaviors and use it within the project that I created my own??

As matter fact, I've tried a few other way that seemed to solve the problem partially..

I copied all the .dll files in the 'Blend 3 Samples' folder under '{program files}\Microsoft Expression\Blend 3\Libraries' folder, and after I've done that, it seemed like the problem was solved..
however, I checked the list of behaviors from the asset window in blend 3, Not all the behaviors were listed in it.

I'm not sure it's supposed to be that way..or can be found in other places.. but.. behaviors that have the word 'trigger' such as 'MouseGestureTrigger', 'MouseEventTrigger', 'StateChangedTrigger', etc were not shown in the list...

How can I get it work~? I'll be really appriciated if anyone can help on this.

oh..by the way, I am currently using Blend 3 trial..I don't know if that can cause the problem..

Thanks.

8:50 PM  

Post a Comment

<< Home