Sunday, October 10, 2010

How is Blend Extensible?

A follower on Twitter asked me if I know anything about Blend extensibility.  The fact is, I think I know a little and I will share what I know.  If you happen to know more than I write about here please feel free to add it into the comments section.  As time goes on I will move those comments into the post itself (if they are correct, that is :)   ).
What is Extensibility?From what I understand, Extensibility is the ability to build functionality upon already existing functionality.  For example if I wanted to create my own Behavior I would extend the Behavior class and my new class would “inherit” all of the base functionality of a Behavior.  Thus I don’t have to re-write that base functionality every-time I want to make a new custom Behavior.

Blend Custom Controls are Extensible:
When you create custom controls in Blend they are highly extensible.  How you ask:
1. Context Menus – When you create custom controls you have the ability to add items into the default context menu.   For example if you had a custom LoginControl you could create a Context Menu Option for something like “Add a Remember Me” Button.
2. Categorization of Properties – When you create a custom control you can not only add properties that will show up in the Properties panel but you can even tell that property where to show up (other than the default Misc. bucket).  For instance, if you have a custom layout property called VerticleOrientation you could specify that property go into the Layout bucket of the Properties panel.  Further, Blend will give you custom adorners for certain properties, out of the box.  For example, if your property is a Double then you get a slider adorner.  If your property is a Color property you will get the ink chooser.  Blend will do this automatically.
3. Customization of Custom Control Adorers – This allows you to build custom controls that have adorners at design-time that allow you to easily customize that control.  For example, say I have a Custom DialogBoxControl and I want the designer to easily change the background color.  Well, I could add a design-time adorner of a color picker and have that value show up as the background of the control.
4. Setting Default Properties – This allows you to set default properties for your custom controls.  This will allow your deisgner to quickly see what properties you have exposed in your custom control.
Blend Project Types and Templates are Extensible
This means that you can build upon the basic functionality of Project Types and Templates to add your own custom ones.  For example, say you want everyone of your projects to have a left, vertical navigation bar.  Well you would build a template that would do exactly that.
Silverlight Behaviors are Extensible
This allows you to build upon the basic functionality of a Behavior and make your very own custom Behaviors.  For instance in this video tutorial I show you how to create your very own Behavior that changes the color of an object when clicked and then back to its original color when the mouse is released.  I then show you how to use it in Blend.
Like I said there are more examples of Blend’s Extensibility and I will leave it up to other readers to provide more examples but this should give you a good foundation and understanding of what Extensibility is and how Blend and Silverlight are Extensible.
Thanks!  Victor Gaudioso

1 Comment for this entry

  • Martin Krüger 
    Hello Victor,
    I would like to point to the extensibilty of Expression Blend 4 itself.
    If someone wants to write a custom Blend 4 extension I recommend the posts of Timmy Kokke on that topic:
    Building extensions for Expression Blend 4 using MEF
    Building a real extension for Expression Blend
    Adding options in Expression Blend extensions
    Additionally there is a useful article on Silverlight design time extensibility from Justin Angel
    Using the basic articles from Timmy Kokke I created my own little Expression Blend 4 Add-In
    Unfortunately there is no official documentation on the Microsoft.Expression.[...] assemblies. But the articles mentioned above are a very good starting point for own exploration of the extensibility of Expression Blend itself.

1 Trackback or Pingback for this entry

No comments:

Post a Comment