UPDATE 11/18 - Re-posted the demo project, removing references to the expression behavior samples. This removes the MouseGestureTrigger demo, but should make the project work stand-alone. If you want to play with the mouse gesture trigger, download the samples from expressionblend.codeplex.com separately, please.
Thanks to all of you that visited my talk at PDC09. I was really happy to see such a large audience and so much interest in prototyping with SketchFlow, and in the opportunities for developers to extend SketchFlow to make it possible for designers to create rich interactivity without code.
In this post: A link to the demo project, and many other links that help you getting started with writing your own behaviors.
When looking at the sample project, keep in mind that it is targeted at developers that want to extend SketchFlow, not at users who just want to play and prototype with SketchFlow - the sample actions are samples for extensions to SketchFlow’s built-in vocabulary of interactivity. In real life, such actions would typically be created by a developer, packaged as a library and added to the default project template that designers use – and designers never even need to know how these behaviors magically appeared in Blend’s asset panel. They’d be just there, ready to be applied with drag and drop, and configured in the property inspector.
As promised during the talk, I will add blog posts soon that explain the sample behaviors that I presented in the talk. As I have not quite written the posts, I wanted to at least give you access to the sample project as it was at the end of my presentation:
The project is based on the SnowboardSketch sample that ships with Blend, but has some differences and extensions, most importantly the sample actions for you to look at. In particular, you want to look at:
- The ConditionalNavigationAction, which is somewhat mis-named – it probably should rather be called LoginAction or something like it. What it does is this: It lets you quickly handle user login scenarios, where you want to compare a user/password combo that a user types in with a list of pre-defined valid user/password sets. On success, it navigates to a success screen, on failure it navigates to an error screen. Note that the player API it uses for navigation is not officially documented, so it may change in a future version.
- The SaveGlobalStateAction and RetrieveGlobalStateAction let you store values in a global data store and retrieve them later. This is useful to preserve bits of state between multiple screens. In the sample project, I use the actions to store the login name of a user and display it later on a different page.
The project also references the Expression sample behavior library from codeplex, which was just used to show off the MouseGestureTrigger. See the web site for more information, downloads and source code (expressionblend.codeplex.com).
While I have not yet written explanations for the samples in the project, there are a good number of other posts on the topic of behaviors on this blog:
- Blend 3 Behaviors: Interactivity without Code
- Blend 3: Triggers, Actions, Behaviors
- Blend 3 Behaviors: A Sample Action
- Type-On_Text for SketchFlow with a Behavior
- SketchFlow: Conditional Navigation Sample. Note that this is a different approach than the sample in the PDC demo.
- SketchFlow: Global State Behavior Sample. This one is a version I wrote a while before the PDC demo, but some of the explanation is probably useful for the other version too.
Other good resources on behaviors:
- The Expression Gallery, where users can share the behaviors they have written. There are quite a number of interesting behaviors posted already.
- A nice collection of links on behaviors
- Jeff Kelly wrote a nice series on various topics related to behaviors: Part I, Part II, Part III and Part IV
And most importantly, if you are at PDC, please absolutely see Pete Blois’ talk on Behaviors, Thursday at 12:30!!!