What is there in Slex?

If you are familiar with Silverlight/Expression Blend, you should be knowing about the System.Windows.Interactions infrastructure – which provides various Behaviors, Triggers and Actions. Slex is an experimental implementation on top of the same, along with few extensibilities and additional triggers and actions.

Triggers in Slex, and actions inside them, can be invoked based on conditions

Slex Preview 2.0

These are some notable aspects in Slex, that are not available in the triggers and actions available with Expression Blend.

Slex allows you to define multiple conditions for invoking triggers (like you can specify a KeyDown event trigger should be fired only if ‘A’ is pressed). Also, You can specify multiple conditions for invoking each action in a trigger. Slex introduces few more Triggers and Actions that you’ll see soon.

As of now, Slex Preview 2 Provides the following Triggers
  • EventTrigger – Will be fired when an event is raised. Can listen to events of Elements, or events from your view model
  • PropertyTrigger – Will be fired when the specified property changes. Can listen to properties of Elements, or property in your view model
  • ReactiveTrigger – Can ‘import’ an Observable that you may ‘export’ using MEF. Useful to define and use custom events using System.Reactive.

And the following actions
  • InvokeMethodAction – Invoke a method directly in the View model or for a target element, supports passing parameters via Xaml
  • InvokeCommandAction – Invoke an ICommand in the view model
  • StoryBoardAction – Start, Stop, Pause, Resume, or Reverse story boards
  • PropertyAction – Sets a property value (very crude as of now)

You can specify one or more InvokingCondition for triggers and/or actions. Also, actions like InvokeMethodAction and InvokeCommandAction has an ActionParameters property, so that you can pass one or more Parameters when invoking methods and commands.

Have a look at few code samples

This is just a preview release, stay tuned. Follow at http://twitter.com/amazedsaint

Last edited Dec 28, 2009 at 8:19 PM by amazedsaint, version 6