» Publishers, Monetize your RSS feeds with FeedShow: More infos (Show/Hide Ads)

For Blend 4, we have added a new extension point to our Asset library - ToolboxExampleAttribute. Like most of our other attributes
Consider this scenario (which we ran into as we were adding new content into our SDK - the various shapes like Star, Arc, Donut, etc): say you have a type Foo that is a Control you want to show in the Blend asset library. However, when Foo is instantiated, you want to set a set of properties. In the past, you could have done this with the DefaultInitializer concept, but the problem is that there can be only one DefaultInitializer associated with a type. And you don't really want to subclass Foo to have different types just for the purpose of having them show up in the Blend asset library.
Enter ToolboxExampleAttribute. Now you can have multiple "examples" of the same type, each of which will result in the generation of different XAML. To use this attribute is very straightforward - you would hook this up just like any other attribute in the design time library. Here is a simple code snippet of how you could use this feature:
internal class ExampleOne : IToolboxExample
{
public ModelItem CreateExample(EditingContext context)
{
//Return a ModelItem instance that sets appropriate properties
}
public Stream GetImageStream(System.Windows.Size desiredSize)
{
//Return an icon image stream
}
public string DisplayName
{
get { return "Something"; }
}
}
And to register the example:
internal class MetaDataStore : IProvideAttributeTable
{
// Called by the designer to register any design-time metadata.
public AttributeTable AttributeTable
{
get
{
AttributeTableBuilder tableBuilder = new AttributeTableBuilder();
typeof(Inker),
new ToolboxExampleAttribute(typeof(ExampleOne)));
return tableBuilder.CreateTable();
}
}
}
Also, you will be happy to know that Silverlight 4 adds a bunch of new attributes to the core platform that would have required you to author a design-time library in the past to supply for your custom controls - some examples of newly added attributes that I really like as the greatly enhance the design-time experience:
System.ComponentModel.AlternateContentPropertyAttribute in System.Windows.dll
System.ComponentModel.DefaultBindingPropertyAttribute in System.Windows.dll
With Blend 4, we have made a number of significant changes to how we generate XAML, primarily with the aim of generating more compact XAML. You will find a couple of these interesting:
a) DoubleAnimation v/s DoubleAnimationUsingKeyframes
In Blend 3, rotating a Rectangle in a Storyboard would give you the following:
<Storyboard x:Name="Storyboard1">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="15.091"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
In Blend 4, you now get the following (Note that you will find the user experience identical between Blend 3 and Blend 4 - if you were to drop an additional key frame, we will convert the animation to the type that lets you do keyframing)
<Storyboard x:Name="Storyboard1">
<DoubleAnimation BeginTime="00:00:00" Duration="0:0:1.6" To="12.228" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="rectangle" d:IsOptimized="True"/>
</Storyboard>
b) TransformGroup v/s CompositeTransform
In Blend 3, rotating a Rectangle would give you the following:
<Rectangle x:Name="rectangle" Fill="White" Stroke="Black">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="15"/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
In Blend 4, you now get the following:
<Rectangle x:Name="rectangle" Fill="White" Stroke="Black">
<Rectangle.RenderTransform>
<CompositeTransform Rotation="15"/>
</Rectangle.RenderTransform>
</Rectangle>
Are there any other areas where you find the XAML being generated by Blend is more verbose than that would you would have liked? If so, I would love to hear about them!
Blend 3 brings to the table really sophisticated support for sample data, enabiling better designability of your applications. In my previous post, I demonstrated how designers could leverage this feature to prototype data connected applications inside Blend . However, for really sophisticated applications, richer support might be desirable - for example, you might want to use your own custom types for sample data in the cases where you cannot re-create the schema from scratch using the primitives that we provide.
Here is a small example that will help you get started on a feature that we just introduced in recently available Blend 3 build – we call this feature “design data”. This feature allows developers to enable designers to be more productive inside Blend for practical LOB applications where there is a clear separation between model and view, and where you can’t use the Blend sample data feature as your UI might depend on your custom business objects (for example, think typed data templates in WPF).
Let us take a quick tour of this example, and see how things work behind the covers:
ShoppingCart.cs defines a data structure that we are trying to visualize in ShoppingCartView.xaml. The type ShoppingCart does not have a public constructor, neither does ShoppingCartItem. Similarly, ShoppingCart has a read-only property ItemsCount. These kinds of limitations are extremely common in real-world data structures (and is being demonstrated here to show how our system handles these limitations just fine, without requiring your to make changes to your run-time code)
The sample data for ShoppingCartView.xaml is defined in ShoppingCartSampleData.xaml, which is included with a special build item type in the project file: <DesignData Include="ShoppingCartSampleData.xaml" />. This ensures that you don't pay any run-time penalties for enabling this design-time only feature.
The contents of ShoppingCartSampleData.xaml look like following:
<local:ShoppingCart
xmlns:local="clr-namespace:DesignDataSample;assembly=DesignDataSample" ItemCount="22">
<local:ShoppingCart.Items>
<local:ShoppingCartItem ItemName="Book Name 1" ItemDescription="A very nice book!" ItemImage="/DesignDataSample;component/MySampleDataImages/Tree.jpg"/>
</local:ShoppingCart.Items>
</local:ShoppingCart>
There are a few things to note about the contents of this file:
a) While the format is XAML, we have relaxed the specification quite a bit. You are allowed to specify a value for the read only property (ShoppingCart.ItemCount, ShoppingCartItem.ItemName), as well as initialize objects that don’t have public constructors (ShoppingCart, ShoppingCartItem). Blend creates on the fly types which look like user types. You could choose to prevent reflection (in which case, what you can specify in XAML is severely restricted) by specifying <IsDesignTimeCreatable>true</IsDesignTimeCreatable> in the project file for the sample data XAML item.
b) You can specify any platform type like Brushes, ImageSource, Uri, etc.
c) You get full intellisense in Blend for typing this XAML.
In ShoppingCartView.xaml, we then hookup the sample data like so:
<Grid x:Name="LayoutRoot" d:DataContext="{d:DesignData Source=ShoppingCartSampleData.xaml}" Background="#FFB2B2B2">
For WPF projects, if your XAML was using typed data templates, you need to add the following attribute to those typed data templates to get picked up automatically, if you were using the reflection based sample data types and you wanted a good design experience.
<DataTemplate x:Type="{local:Foo}" d:IsDesignTimeCreatable="False">
This particular sample data feature will also be supported in VS 2010. As always, please don't hesitate to ask for further clarifications, and I really value your feedback on how we could make this feature more useful for you.
Here is a collection of a few of the blog posts I came across around the new databinding features in Blend 3. Hope you find them useful!
Sample data
http://blogs.msdn.com/usisvde/archive/2009/06/17/blend-3-great-feature-1-sample-data.aspx
http://silverzine.com/tutorials/how-to-create-sample-data-in-blend-3/
http://www.85turns.com/2009/07/12/overview-of-sample-data-in-blend-3/
http://www.cynergysystems.com/blogs/page/michaelwolf?entry=silverlight_blend_3_sample_data
http://blogs.msdn.com/unnir/archive/2009/03/18/introducing-sample-data-support-in-blend-3.aspx
Master/Detail scenarios
http://blogs.msdn.com/usisvde/archive/2009/06/18/blend-3-great-feature-2-master-details-screens.aspx
Element to Element binding
http://blogs.msdn.com/usisvde/archive/2009/06/19/blend-3-great-feature-3-silverlight-element-binding.aspx
TreeView control
http://geekswithblogs.net/tkokke/archive/2009/06/29/styling-a-treeview-in-silverlight-and-blend-3.aspx
http://shawnoster.com/Blog/Silverlight-TreeView-Connecting-Lines-And-Blend-3-Support-for-HierarchicalDataTemplates
DataGrid control
http://blogs.msdn.com/unnir/archive/2009/03/19/datagrid-support-in-blend-3.aspx
AutoCompleteBox control
http://blogs.veracitysolutions.com/how-to-get-a-silverlight-3-autocompletebox-to-show-sample-data-in-blend-3/
Under the covers (Advanced topics explaining the magic behind all this!)
http://blogs.msdn.com/unnir/archive/2009/07/12/introducing-sample-data-for-developers.aspx
http://etvorun.spaces.live.com/
http://www.robfe.com/2009/08/design-time-data-in-expression-blend-3/
If you do run into a situation where the Blend flyout menus appear on the left instead of the right as shown below, the Tablet PC Settings panel is a good place to check.


While Blend 3 has a number of stellar features that I am sure everyone reading this blog has heard about (buzz words include SketchFlow, behaviors, sample data support, Illustrator and Photoshop import, TFS support, and many more), we really devoted a significant amount of time to address issues that you reported via Connect, that we hope will help you be more productive inside Blend. Here is a compilation of my favorite top-10 feedback items we addressed (in random order). Thank you very much to all you Connect contributors, and we really hope to hear more from you.
a) Numeric editors for Gradient Stops
Designers like to precisely control the positioning of gradient stops. Blend 3 adds this ability.

b) Better handling of Layout properties in common operations like copy/paste
With Blend 3, we have made a good, sincere attempt to streamline the properties that we set in common operations like copy/paste and double-click to insert. We also try to generate a clean as XAML as possible.
c) Consolidate the style and template editing menus
I could not find the Connect bug link for this one, sorry! While the concept of Styles and Templates offers enormous potential, it also make it challenging for a tool like Blend to offer access to them, and at the same time make us approachable to users who don’t care about the separation. While we did a pretty good job of trying to abstract away the concepts of styles and templates, and while a lot more can be done, Blend 3 makes it possible to access all styles in the context menu. No need to go the Object menu to edit the ItemContainerStyle of a ListBox.
You can read about this in a previous post of mine here.
e) Expand/Collapse state of projects across solutions
Each time you close and reopen a solution that contains multiple projects, we now remember the expansion states of each project in the solution. We also remember the set of documents you had open inside Blend so you can restart working where you left off immediately.
f) Preserving XAML readability when trying to copy templates in WPF
This is a WPF only improvement we made to Blend 3. In WPF, Blend allows you to edit copies of controls’ templates by reverse engineering the XAML from the BAMLized resources. While this is great to have, it is also essentially lossy operation. As an example, any static resource references like Brushes get inlined (and consequently, the XAML becomes a little less user-friendly). Blend now allows custom control vendors to specify the original XAML file that should be used at design-time for template editing in the design-time assemblies (another post is required to show how you could take advantage of this if you were in the business of writing complex WPF controls and wanted to better enable designers). We also correctly copy the templates from the original Generic.xaml in many more cases when the original source is available.

g) Typing in the split view XAML editor steals focus
There were many cases where the design surface would steal focus from the XAML editor that would make it very annoying to type in the XAML editor. All of those should now be fixed, and along with support for intellisense in the XAML editor and a highly performant, robust-to-errors/exceptions XAML parser, typing in the XAML editor should be a really enjoyable experience for you (though we also work pretty hard to keep your XAML typing skills usage to a bare minimumJ).
h) Arrange-by (z-index) is not preserved across sessions
The order in which elements appear in XAML does not always play well with the cognitive understanding of who like to see elements that appears higher in z-order to appear higher in the object tree. While Blend 2 had the ability to switch the visualization order in the object tree, we made it hard for users who would have to set this every time they opened a solution. Not anymore!
i) Keyboard shortcuts fine tuning
This is a pretty hard problem to solve without free-form keyboard customizability and presets for shortcuts (a feature that is missing from Blend 3). But we made a pretty sincere effort here. For example, you can now customize the mouse zoom/scroll behavior for the design surface to your liking.
j) And finally… Blend – so bad
We totally fixed this! Hope you enjoy using Blend 3 J.
For Blend 3, we have completely re-designed the Asset Library.

Here are some of the highlights:
a) Categorization for various assets makes discoverability easier.
b) Searchability allows for quick location of an asset across categories like Controls, Effects and Behaviors.
b) Freely dockable anywhere in the UI. We also have left the popup mode unchanged for quick one-time access to assets.
c) Extensible - you can register your own assets that make it easy for inclusion into the projects on an on-demand basis. Adding an asset like a Control or a Behavior will add all necessary references required for the functioning of the project automatically.
d) List and Grid modes for the display of assets.
Registering your own library (or sets of libraries) in the asset tool is very simple. All you have to do is to setup a registry key that points to a folder containing the libraries. As an example, the Silverlight SDK registers itself into the Blend asset tool using the following key/value pair on a 64-bit machine:
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Expression\Blend\3.0\Toolbox\Silverlight\v3.0\Silverlight SDK Client Libraries
Value: c:\Program Files (x86)\Microsoft SDKs\Silverlight\v3.0\Libraries\Client\
For a WPF example, the following is the way the WPF ToolKit registers itself on a 32-bit machine:
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend\3.0\Toolbox\WPF\v3.0\WPFToolkit
Value: C:\Program Files\WPF Toolkit\v3.5.40320.1
There are a few things you can customize around the display of assets:
The Icon: For supplying a custom icon, all you need to do is to add an image to the control library (preferrably its design-time library that helps keep the size of the library small) that uses the namespace qualified name of the control for its name. For example, say you had a custom control Foo. The icon would be then called FoosNamespace.Foo.png. Few things to keep in mind: Use EmbeddedResource as the build item for the Image. Blend's asset library only supports PNGs. If you wanted a 24x24 and 12x12 version of icons (since we use these two standard sizes in various places of our UI), all you have to do is to name the PNGs as follows: FoosNamespace.Foo.SmallIcon.PNG, and FoosNamespace.Foo.LargeIcon.PNG. The SmallIcon/LargeIcon part don't actually matter - you can pick a string of your choice, and we will dynamically determine and pick up the appropriate icon for display.
Description: You can use the DescriptionAttribute to change the string that is displayed as a tooltip for the asset.
Asset Library availability: If you wanted to prevent a particular asset from being visble in the Asset Library, you could use the ToolBoxBrowsable attribute as a part of the metadata specification for that asset in the design-time library.
Location in the category hierarchy: Again done via a newly introduced attribute (ToolBoxCategoryAttribute) that you can supply via a design-time library.
The last few weeks (or months) have been really hectic! We finally finished all the features that we wanted to add to Blend 3, and are now actively fixing all the feedback (read bugs and crashes :)) that you have been reporting to us, as well as making performance tweaks to the product to make things work really well end-to-end. Please keep the feedback coming - we really appreciate it.
Here is a (random, off the top of my head) sneak peak into some of the new features we are adding to Blend 3 in the upcoming release, since the last Blend 3 Preview:
- A completely re-designed Asset Library: This is by far the biggest addition to Blend, and I am sure you will love it - after all, its dockable! More information on this later.
- The sample data system now allows you to specify custom objects (like Brushes and your business objects), that just completely opens up the Blend sample data system for developers to better enable designers. I will post a sample of this shortly. In addition to this, we also added support for TreeView and binding to recursive collections.
- Project pane search - you can easily find the files in your project, similar to what you would do for properties.
- Find in Files - this allows you to search for information across files.
- Better paste functionality - we now allow you to paste images from the clipboard.
- You no longer need to build your projects to preview changes to UserControls.
- Marquee selection of keyframes that allows you to select multiple keyframes easily in the animation window.
- A lot more functionality to make Behaviors even more easy to create and use like an easier way to pick elements, re-use the element, storyboard and state pickers, etc. This is addition to newer set of Behaviors and Actions that will be available out-of-the-box.
- State editing experience - we now allow you to view previews of transitions on the design surface as you switch between states.
- FluidLayout is a new feature that we a adding that allows you to design animated, dynamic layout experiences.
- Support for out-of-browser Silverlight applications.
- A much improved, highly performant, XAML editing experience that is robust to the typing experience (i.e. a design surface does not throw exceptions or blanks out as you type in the XAML, and one that allows you to work with an element even when an exception is thrown so you could correct your errors in the UI).
- A Blend SDK that allows for Blend created projects to be portable between designers and developers without actually requiring a Blend install.
In addition, we also spent a significant amount of time polishing up the Blend UI. Just simple things that required attention to detail and will make your overall experience with the product enjoyable - hope you will like them.
Watch out Christian's blog for the SketchFlow additions - I think SketchFlow is clearly the crown jewel of Blend 3. We also spent a significant amount of time polishing up the Blend UI, and hope you will like the improvments.
Really looking forward to June and your feedback!
A number of people have sought more clarity around how Blend and resources references work inside WPF projects. Hope the following FAQs would help with some of your questions.
a) Should I use Static or Dynamic resource lookup?
Blend def. plays better with dynamic resource lookups. You could use a static resource lookup as long as the resource was not located or merged into App.xaml. People have raised concerns around performance issues with dynamic resource lookups (you pay for what you get). While that might be true, an interesting data point is that the Expression Blend source code uses a ton uses dynamic resource lookups for our own UI (of course, we too use static resource lookups in places where the resource would never change, or where it not possible to use a dynamic resource extension, for example non-DPs).
b) If I had to used a static resource lookup, why don't things work when the resource is located in App.xaml?
When a static resource lookup is done inside the Blend design surface, unfortunately, the resource ends up being looked inside the Application object of Blend (which is in itself a WPF application). This does not play well with the way we host the design surface - we don't want to merge the user resources into the Blend Application object to avoid conflicts with the Blend UI styles. Please be assured that solving this problem is pretty high our wish list (and we are working with the WPF team on a solution).
P.S.: If you do run into this issue, the most common symptom is that an exception is thrown on the design surface when you try to instantiate your control which reads something like - XamlParseException - Cannot find resource named '{Blah}'. Resource names are case sensitive...."
c) How can I create a control library of resources and use those resources in a different project?
Here is an example solution that shows you the setup.
d) What is a recommended pattern for organization of resources into external resource dictionaries?
Where there is no single pattern that I have noticed and it really depends on your scenario, an interesting data point is that the Blend source code itself only consists of a few resource dictionaries - we have one for a bunch of colors and brushes, and one for the styles for the common controls we use in our UI. Of course, we have two sets of these - one each for the Expression Dark and Light themes. Of course, fewer number of resource dictionaries helps with better performance inside Expression Blend.
e) What if I was instantiating resources from code? How can I make my application more design-time friendly?
Here is a blog post that might help.
A new extension point we have added to Blend 3 (based on very popular demand) can be seen put to good use with the Silverlight Chart control - we call it the AlternateContentProperty attribute. Annotating the properties of a control with this attribute allows you to select objects that are set as values (including DepedencyObjects) to be selected in the Blend object tree, thereby exposing a ton of new functionality like the ability to set properties on those objects, edit templates if those objects were FrameworkElements, or set new objects as values of these properties.
Kudos to the Silverlight toolkit team for jumping onto this (I hope a lot more people notice and use this feature in Blend 3 as it really, really enables designers).

Based on popular demand, here is a quick sample (WPF only though it would be very easy to port this as-is to Silverlight - currently busy with Blend 3 work and all the cool newer features we are adding to Blend 3) that will allow you to get started on the following new extension points we have added to Blend 3:
a) The new way to specifying metadata for your controls
b) DefaultInitializer that allows you to set properties when a control in instantiated from the Blend asset library
c) Custom context menus
d) An adorner for the control
Let me know if you wanted some samples for any specific scenarios you might be interested in.

Writing a design time experience for a Silverlight control can be a bit intimidating (the experience for WPF controls remains unchanged from Blend 2 - just that you now have a ton more extensibility points - unless you wanted to re-use the same design-time code for the WPF and Silverlight versions of your controls). Let's try and understand how this works (because once you know the basics, its a breeze!).
Here is a project template that will help you get started immediately. All you need to do to use this project template is to unzip the contents to a folder like C:\Users\<username>\Documents\Expression\Blend 3\ProjectTemplates. Also, sorry - I did not have time to create a VB version yet.

The project created from this project template works as follows:
- Two control libraries are created each time you create and instance of the project template. For example, lets assume the the user chose the name "MySilverlightControl" as the name for the control library. The two libraries that are created are called MySilverlightControl.dll, and MySilverlightControl.Design.dll.
- The output path of MySilverlightControl.Design.csproj is set to copoy the library alongside MySilverlightControl.dll in a sub-folder called Design. This is identical to what you would do for a WPF control library - adding the design time library to a sub-folder prevents pollution of the "Add Reference" dialogs in the tools.
- MySilverlightControl.Design.csproj is basically a WPF control library project (all the user interface components for the design time experience and metadata that you will specify for the controls are using the desktop CLR/WPF), and has the following:
- A project-to-project reference to MySilverlightControl.csproj
- Because MySilverlightControl.csproj is a Silverlight project (and because we want to use Silverlight types when we code the design time experience - more on this shortly), we need to add a reference to the Silverlight System.Windows.dll
- References to the two Blend 3 / VS Next shared extensbility libraries - Microsoft.Windows.Design.Interaction.dll, and Microsoft.Windows.Design.Extensibility.dll. (Note: In Blend 2/VS 2008, we also had Microsoft.Windows.Design.dll - the APIs in this dll have been moved into the other two libraries, and MWD.dll is no more)
- Because you have references to PresentationFramework.dll and System.Windows.dll, there is a conflict of types when you use a type like Button which exists in both. To help reslove this conflict for the compiler, we setup an alias for the Silverlight System.Windows.dll - TargetPlatform. Any type that is referenced using TargetPlatform::X.Y.Z is now resolved against the Silverlight assembly.
- For both WPF and Silverlight control libraries, while the way you specify the metadata tables is still compatible with VS 2008 / Blend 2, the registration mechanism has a breaking change. You now need to use an assembly level attribute - ProvideMetadata - for this. You can find an example for this in MetadataStore.cs in the MySilverlightControl.Design.csproj.
While there are clear benefits to the approach we have chosen to support both WPF and Silverlight controls (same extensibility APIs so you don't have to learn two sets of APIs, ability to reuse the code for your design time experiences for WPF and Silverlight version of your controls by simply creating platform specific versions of the design time libraries), there are some pitfalls for advanced scenarios that can be easily avoided:
- There are breaking changes to the APIs. Because Visual Studio 2008 SP1 GACs assemblies, unless you had a strong reference to the new assemblies, you might get compiler errors if the assemblies don't resolve to the new versions. Another option is to copy the assemblies locally into the project, and reference them from there. This issue will be addressed in a more convenient fashion shortly.
- It is very easy to to unknowingly pass in a platform specific object (say System.Windows.Point) into an API (for example, the ModelItem ones to set values) where the platform is not compatible. This can be easily avoided by using aliasing appropriately.
- The .Net 3.5 SP1 WPF markup compiler (which comes into play when you try to define WPF UI for your desing-time - for example, a custom category layout for the property inspector or an adorner) does not play well with the aliasing system. To avoid this, consider separating the UI for the design time into a separate project that is a WPF only and has no references to the Silverlight assemblies.
Enjoy, and please do let me know if you run into issues as you work with Silverlight design time experiences so we can address them.
Blend 3 adds really cool support for the DataGrid control (for both Silverlight 3 and WPF Toolkit). Here is a quick demo to help you get started. Enjoy!
- Create a new Silverlight 3 application
- Search and instantiate the DataGrid control from the asset library. (As a side, this also demonstrates the newly added support for having custom controls in the Blend asset library - instantiating a custom control adds the necessary assembly references to the project, in this case System.Windows.Controls.Data.dll for Silverlight)

- Create a data source that has a collection, with one or more properties. (You can easily do this using the new sample data features in Blend).

- Drag and drop the collection onto the DataGrid - its that simple! Blend will automatically generate the right kind of columns for the various properties in the collection. (TIP: You can select indiviual properties using Shift+Select if you did not want a column for each property in the collection. You can even add the columns individually by dragging and dropping each property onto the DataGrid. Your can right click on the DataGrid to add new columns if you wanted to go that route.)

- Select a DataGrid column (the one that corresponds to the Image column), right click on the column, and edit the CellTemplate. You can now edit this template just like you would any other template. (TIP: The properties of the DataGrid columns are also available for manipulation via the property grid).


To help you walk thru some of support we have added for sample data inside Blend 3, I wrote a hands-on-lab that takes you thru the basic experience of building a simple master/detail visualization. While there are a lot more scenarios that are possible with the support for sample data in Blend 3 (some of which are not available in the public preview build, and I will in write in detail about over the next few days), you can get a first-hand experience here for the following:
- A schema designer that allows you to quickly mockup a data source and supply values for the data
- Improved drag/drop experience to create bindings
- Master/Detail support in Blend 3
- Sample data that can be enabled/disabled when the application is running
- Optionally, if you are developer and are interested in knowing more about how things work behind the covers so you could adapt this for your scenarios, this can be a good starting point.
Download the hands-on-lab document here (because of the ISP that I use for hosting these files, you will have to rename this .zip file to .docx), and the starting project (to save you some time with the graphics, styling, and layout) here.

I am sure you must have heard - Expression Blend 3 Preview is here! And I am back after a 2 year break from writing on this blog - if you were to use the product, you will realize what kept us busy :).
If I were to list the new features in Blend 3, it would take me a day to write. Instead, I am going to list just the set of features that I personally was responsible for:
a) The new databinding experience - We have radically redone the databinding experience in Blend 3. Be sure to check out the newly introduced support for sample data, which is a huge enabler in design scenarios that previously required writing code, or were just not possible. We also have brought to the table an unmatched DataGrid editing experience, and added have support for easily creating Master/Detail visualizations (Did I mention that creating the "Hello World" of RIAs - an RSS reader - is only a couple clicks away in Silverlight 3 using Blend 3?). More on all this shortly...
b) XAML Intellisense - easily the number one requested feature of Blend. Also, Blend now has C# and VisualBasic code editing.
c) TFS support - read more here
d) Silverlight and WPF Extensibility - read more here
A bunch of other small things that I will cover over the next few days (there are also a few more tricks that we are still holding up our sleeves, and unfortunately, I won't be able to share much information about them). You also can watch a quick video of me introducing Blend 3 here (it is very, very hard to do justice to most Blend 3 features in 20 minutes, let alone all of them!).
Hope you enjoy using Silverlight 3 (my personal three favorite SL 3 features - shaders, projection transforms, and support for out-of-browser apps - which are yours?) and Blend 3, and please don't hestitate to ask questions.
Based on popular customer feedback, we have added a number of new extensibility points in Blend 3 (sorry, no support for plugins, yet, but who needs an officially supported extensibility model anyway? :) )
Over the next few weeks, I will provide more information on these, including interesting use cases that are already starting to pop up. Here is a quick listing of what we currently support:
- Project and item templates: We support the same formats as Visual Studio, with some very minor modifications to suite our user experience. User project and item templates can be copied into C:\users\username\Documents\Expression\Blend 3\ProjectTemplates and \ItemTemplates respectively. We do not support wizards yet.
- The Blend Asset Library
- Ability to register your custom controls. For example, to register a control library Foo.dll, all you need to do is to add the path to the control library as a value of the following registry key - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend\v3.0\Toolbox\Silverlight\v3.0\MyCustomControlLibraryKey. If this were a WPF library, the key you would setup is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend\v3.0\Toolbox\WPF\v3.5\MyCustomControlLibraryKey
- Adding an asset adds necessary assemblies to your project
- Support for custom control icons
- Setting custom properties on your control when they get instantiated - DefaultInitializer.
- Design surface for custom controls
- Custom context menu commands
- Adorners
- Selection/object manipulation APIs
- Property grid extensibliity - same support as Blend 2, with a few minor additions here and there
Some other notes:
Blend 3 will share the same extensibility model as the next version of Visual Studio.
As we live in a world where there is greater and greater parity between WPF and Silverlight, we wanted the same for these APIs wherein you could use the same design time code to target controls for both platforms. To accomodate this, we had to make some minor breaking changes to the VS 2008 APIs (hopefully the changes will be very straightforward to adapt to) - I will try to post a number of samples to help out with this. By and large, the APIs remain the same as documented here (the documentation will be updated to reflect the breaking changes at a later date).
The APIs are not final yet, and are subject to change. Hopefully, we can keep the changes to a minimum.
Expression Blend 3 Preview adds support for integration with Team Foundation Server, one of our top feature requests.
Some examples of the various integration points:
a) Saving a file automatically checks it out
b) Adding a new UserControl or assets to a project automatically adds them to source control
c) Renaming or deleting files automatically renames or deletes items under source control
d) Right clicking on an item that has been modified under source control allows you to submit that particular change
e) View history, get latest versions of files or specific versions, undo changes, etc.
To enable source control for a solution open inside Blend, the solution must be bound and residing in a valid workspace on the client. You can refer to the Visual Studio documentation on how to setup a solution under TFS source control here.
While you don't need to have Visual Studio 2008 installed on the machine to avail TFS support inside Blend, you do need to install Visual Studio Team System 2008 Team Explorer, a free download. You also need to install SP1 of Team Explorer, and a hotfix for Team Explorer SP1 that enables TFS support inside Blend - you can download that from here.
Enjoy!
With Expression Blend RC1 (if you have not gotten that yet, you should – there are some very cool samples in there – get it here), we “unknowingly” enabled a few scenarios that are cool. For our v1, we really wanted to support these scenarios using a richer design surface and were disappointed when we ran out of time. However, for the brave-hearted, you can still do some cool things around typography.
For example, take letter-pair kerning and tracking. Here is how you could do this in Blend.
1) Create a new Project (File -> New Project) and save it to some location
2) Draw a TextBlock using the tool-bar and type some type text – say “Text” and switch back to the selection tool.
3) In the property grid, search for “TextEffects”. Increase the font size and change the font family to something interesting.
4) For this property, bring up the collection editor. Now you are ready to add a custom text effect.
5) Click the “Add” button this will add a new effect.
6) For the PositionCount property, use 1 as the value. This means that you want to edit one character at a time as opposed to a range.
7) For the PositionCount property, use 1 as the value. This means that you want to offset the 2nd character (as most of the things in .Net, this is 0 based).
8) Now use the transform editor to translate the character as you want!

If you have dual monitors, you can move the collection editor to the secondary monitor and you will see that any changes you make to the modal collection editor and updated on the design surface in real-time, which is pretty cool.
While editing using the collection editor is not ideal (and something we would like to fix in the future), this is such a specialized editing operation that I think people will sacrifice the editing convenience for the coolness of the feature (at least for the time beingJ). It does not end there – you can arbitrarily transform each character like rotate them or scale them. You can also animate these effects so you can do effects like “characters falling from the sky”. Try it out and give us some feedback.
We listened to your feedback and worked a large number of new features to help you become more productive + improved a lot on our old set of features. Explaining all the new work would probably be too much for a blog post, but I will try to highlight on all that I can recollect. Give it a shot!
- Project system
- Solution support: We now support opening solutions (.sln). This lets you work seamlessly with Visual Studio and your favorite developer without frustrations.
- User Controls: User Controls let you compose your UI into more manageable entities – gone is the day of that humongous XAML file that tried to describe your entire application’s UI. Check out File -> Add New Item that lets you create these. We also let you embed User Controls within one another and let you jump out to the appropriate User Control (within a project and across projects) to edit them. Right click on a User Control that you have embedded in your application to edit it.
- Re-designed user experience
- The new Expression Dark theme: The dark theme is meant to let you focus on the design surface, and puts everything else in the background. We also plan to support a lighter theme (called Expression Light) for those paranoid of dark user interfaces – however, this is something that we have yet to work on although you can see a placeholder for the same in the Options dialog).
- Workspaces: We ship with two distinct workspaces – one of the workspaces lets you have a wider timeline palette and is useful for complex animation sequences. In addition, you can undock any palette to your secondary monitor.
- Shortcuts, shortcuts, shortcuts: Almost everything is now accessible using keyboard shortcuts. My favorite (and did we miss this!): Hit Tab to hide all palettes so you could focus on your work. When you hit tab, we have enabled a special mode for the property inspector that lets you make quick edits to a property without making the entire UI visible.
- Focus issues: In keeping with the various professional design tools out there, and quite contrary to Visual Studio’s design surfaces, the focus is almost always on the design surface. This lets you quickly navigate between different functionality, with lesser number of clicks.
- Property editing experience
- Context sensitive property grid: One of the biggest differences you will see in Blend is that we moved away from the palette metaphor. The palette metaphor works great for drawing tools which have a limited set of things you can manipulate, but for WPF and all its richness, it can become a hassle since you need many, many palettes. Enter the context sensitive property grid which tries to blend (no pun intended) the best of both worlds: You get categories that try to preserve the well known palette metaphor, and that you can collapse to hide. But you also get a one stop shop for setting practically any property in WPF.
- Search for properties: The search feature in the property grid is well integrated to search across categories.
- Brush and color editors: We have done a ton of work on these, and it would probably warrant a post of its own. Couple major things we integrated, thanks to your feedback: Specifying Hex values and values in the 0-255 range, and the ability to pick color and brush resources.
- Extensibility: The property editing experience is extensible, meaning you can write your own categories, and editors for your properties. In addition, the extensibility API for the property grid is the same as that exposed for Visual Studio – so with one bullet, you can target two sets of audiences. I will detail this out in a following post. The cool thing here is that we have written a lot of Blend’s property grid against this API – so that shows the power.
- Collection editor: Lets you edit collections of things like BitmapEffects, items in a ListBox, etc.
- Create and apply BitmapEffects: Now you can create and apply your favorite BitmapEffect using Blend. However, standard warning applies: BitmapEffects are rendered in software in WPF, so be subtle in their use if you want fast user experiences!
- Asset creation
- Tool bar: Tool bar lets you create elements like shapes, and some common controls, in addition to the various standard tools like selection, zoom, and pan.
- Asset tool: Asset tool replaces the library palette and provided the one stop shop for creating any WPF or custom control. The asset tool also maintains an MRU list of controls that you create so you can quickly create a second instance. The asset tool palette lets you drag and drop control so controls get instantiated at their default size or you can double click to instantiate a control at a certain specific size.
- Search: Like the property grid, the asset tool lets you search for controls so you can quickly find them.
- Better workflow with Microsoft Visual Studio
- Edit projects in Visual Studio: Right click on a project or solution file in the project pane to edit in Visual Studio. Now you can right click on any file and chose to edit it in Visual Studio. It is great fun (and highly productive) to be using Visual Studio and Blend on a two monitor setup! Any changes you make in Visual Studio are automatically picked up by Blend.
- Add event handler code in Visual Studio: We simply did not have enough time to provide a great coding experience. But don’t worry – we more than made up for it by falling back on Visual Studio. You can choose to setup Blend such that when you add an event handler, the right file will be opened up in Visual Studio and the handler added for you – all ready for you to code away.
- XAML editor
- View XAML: Right-click on any element, resource, etc. and quickly jump to the corresponding XAML. This is extremely useful when you don’t really know where something is located in XAML.
- Find and replace: Lets you find and replace stuff in XAML. Also lets you jump to a different line.
- XAML coloring: Pretty standard stuff. We also color markup extensions (stuff like Bindings, Resource references, etc.) with a different color so you can quickly find them.
- Resource management
- Is my resource missing? If it is, we will show it to you. Any missing resource references are shown in the results pane. You no longer have to debug your application to figure this out! WYSIWYG.
- Manage resources. We let you drag and drop and copy and paste resources across various resource dictionaries – application level, document level, and external. We try to be smart enough to ensure that your document is never “broken” when you move resources around, and will prompt you when the document integrity cannot be maintained. This is a major feature that we worked on – we wanted to make sure that you could manage resources as an after-thought.
- Resources pane: The resources pane is your one stop shop to see resources that are being used in your current document, and all other resources that can be applied. You can edit most resources directly from within here (and better support for this is coming in the near future – this is a work in progress). You can drag and drop a resource from the resource pane onto your element – this makes it very easy to work with any pre-defined resources that you may have.
- Filter resource: Imagine that you have 10 different resource dictionaries, and 100s of resources. How do you figure out all the resources that are being used by an element so you could edit them? Use the “Filter” button in the resource pane to only see resources that are currently being used by the selected element (Styles, brushes, etc.).
- Create resources out of virtually anything. In our previous CTP, it was not possible to create and apply Visual Brush resources. Now it is – the key scenario here is to create one or more reflections that are “live”.
- Layout and drawing
- Snapping: You can snap to other elements, text baseline, and grid rows and columns – forms layout is now as easy as ever. You can also have a snap grid that helps for vector drawing operations.
- Boolean operations: We support a variety of Boolean operations on paths – Unite, Divide, Intersect, Subtract, Exclude, and Exclude Overlap. Check out the Object - > Combine menu.
- Fill an element in a container: Right click on an element -> Auto Size -> Fill to cause the element to occupy all the size made available by its parent.
- Timeline and interactivity
- A workspace that is completely dedicated to let you focus on creating animations.
- The completely redone triggers pane lets you create and edit various kinds of triggers. A follow up post will be necessary to explain all of it, but you no longer have to hunt around for a way to trigger a MouseOver animation or create a MousePressed state.
- Drag and drop to reorder elements in the timeline.
- Timeline is now automatically expanded to show selection on the design surface.
- Miscellaneous
- XAML is as clean as ever: We listened to a ton of feedback from you, thanks! As a result, the XAML we generate is very concise – no extra precision, extra attributes.
- Documentation: Tooltips for various WPF (and custom) controls is now available right within the product. In a future release, all properties will also have a brief documentation associated with them.
- Color eye-dropper: This lets you sample colors from anywhere on the desktop.
- Gradient eye-dropper: Ever saw a nice line gradient that took time to reproduce? We have a solution for you. This is one of my favorite subtle features. You can sample gradients from anywhere within Blend or outside it on the desktop.
- Object Data source dialog: An improved data source dialog that lets you search for a type that you want to add as data source.
- Simple style editing: Let’s admit it. WPF control can be difficult to edit primarily because of two reasons: they try to compliant with the standard Aero (on Windows Vista) and Luna (on Windows XP) counterparts, often a lot of their functionality is baked into code for performance reasons. To make it easy for our users, we now ship with a set of styles for all the standard controls that you might want to edit (check out the Asset tool -> Simple Styles) – these styles are not functionally complete but they provide a great starting point for customization. When you use a Simple Style, all we do is include an external resource dictionary will the style definition.
- 3rd party control licensing – If you are 3rd party writing a WPF control, you can take advantage of licensing functionality baked into the tool. Users of you control will have to acquire a license from you before using your control.
- Design time detection – You can now easily figure out when you control is running on the design surface (How? – a follow up blog post will explain). This lets you, among other things, populate data structures with data that is only available at run time (for example, at the click of a button) so you could design you application better.
- Cut/Copy and Paste has been greatly improved: When you cut/copy and paste an element, we will copy all necessary resources that are required to preserve the integrity of the document.
If you reached here, you probably will have a lot of questions (in addition to positive and negative feedback!). Please feel free to ask and share your feedback…
It took a while, but we finally managed to get it done. Previously code-named "Sparkle", then named "Microsoft Expression Interactive Designer", we finally settled for "Microsoft Expression Blend". There is more to it than just the new name - download and try now from http://www.microsoft.com/expression. (It will be a while before the site updates make their way thru the server farms, but try http://www.microsoft.com/products/expression/en/expression-blend/try.mspx)
If you offered us feedback either via the Newsgroup or Connect, we are very thankful to you. We also wanted to thank you for your patience as it has been almost a year since we published anything - this time, we wanted to take the time and do it right! You will notice that we really listened to your feedback and we will continue to do so thru the Beta period - if you really want to see a feature that is greatly missing from Blend, now is the time to let us know. As soon as I get a few minutes to finish it up, I will post a list of things that I think are cool in this new Beta (and yes, it will be a long list).
I tried my best to make sure any bug you reported via Connect or the Newsgroup would get fixed. However, I am sure we missed a couple (as is always the case). My apologies - please let me know - we will def. fix them for the next release.
Have a great holiday season!








