Expression Blend 2 September Preview

September 15, 2007 at 3:58 pm (Blend)

The Microsoft Expression blog announced the release of September Preview of Expression Blend yesterday. This is my first hands-on look at some of the new features in this release. clip_image002

SplitView

The first thing of note is the new splitview displaying both the XAML view along with the Design view. This is really useful for making quick edits to the XAML directly and seeing it without having to switch between the two like before. You can still display the two views separately. The default, which can be change in Document settings, is the new SplitView.

Personally when editting XAML, I will still be using Visual Studio for the Intellisense and auto-formatting. Having the Splitview available, I imagine that I will stay in blend more often to use it to quickly change properties within the controls using the XAML portion of the view. I think I will keep the Design View as the default view since when I’m in Blend, I’m wiring up bindings and such.

XAML Editor Options

The XAML Editor has been one of the pain points when using Expression Blend. The fontsize was too small, especially when demo-ing blend on a projector. Tabs were always different from Visual Studio. The font was hardcoded. I’m really happy to see Microsoft have addressed this.

I changed the default font to Consolas. In addition, I made the tabs be 4 spaces to keep the XAML clean and consistent with my settings in Visual Studio.

clip_image004

Making Controls from Existing Objects

Similar to the ability to re-factor code by extracting chunks of code into methods. XAML elements and animations can now be extracted into a their own user control. The user control can now be re-used to reduce duplication of XAML. Also, you can right-click on a control already laid out on the design window and select Edit control to modify it.

Storyboard Picker

The new Storyboard picker is more robust. Like before, we can select the storyboard timeline. We now also have to options to delete, duplicate, and reverse timeline. Making mouse enter and mouse leave effects will be a lot quicker with the new storyboard picker.

Permalink Leave a Comment

Building a WPF Tag Cloud

June 6, 2007 at 9:26 am (Controls, WPF)

I wrote about building a Tag Cloud with WPF on my work blog: http://blogs.vertigo.com/personal/alanl/Blog/Lists/Posts/Post.aspx?ID=18

Permalink Leave a Comment

Blend Gotcha: Content is auto-sized with Layout Type change

June 4, 2007 at 11:18 am (Blend, Gotchas)

When you “Change Layout Type” functionality, the current build of Expression Blend will auto-size the contents.  Make sure to reset the content’s Width and Height properties.

image

image

Permalink Leave a Comment

New Projects using Blend vs Visual Studio

June 1, 2007 at 2:32 pm (Blend, Visual Studio)

Just a heads up. Currently, creating new projects using Expression Blend (v 1.0.1.083) and Visual Studio 2005 (v 8.0.50727…) differ dramatically. Besides the obvious naming differences, the Visual Studio windows application template includes many more references than the Blend standard application template. Also the Visual Studio templates treat project properties files differently by placing the files inside of the Properties folder. The Blend template simply adds a generic AssemblyInfo.cs file that states “Do not modify.” In general, I would start with creating the project in Visual Studio, unless I’m creating one-off prototypes.

New Project in Visual Studio

image

New Project in Blend

image

Permalink Leave a Comment

Blend Tip: Quickly Change The Startup Window

June 1, 2007 at 1:44 pm (Blend, tips)

The startup window can be changed in Expression Blend by right-clicking on the new window that you want to to the startup, and selecting the Startup menu item in the context menu.

image

Alternatively, you can just as easily modify the StartupUri property in App.xaml to point to a different window.

image

Permalink Leave a Comment

Blend Tip: Edit Externally

May 22, 2007 at 2:41 pm (Blend, tips)

To open a project that’s already opened in Blend in Visual Studio, you can simply right-click on the project file in the Project panel and select “Edit Externally”. Similarly, you can just right-click on a single and select “Edit Externally” for that file.

Permalink Leave a Comment

Josh Smith: Thinking in WPF

May 8, 2007 at 5:46 pm (Guidelines, WPF)

I admire Josh Smith and his WPF knowledge. I’ve learned a lot about WPF from reading his articles, posts, and samples. Recently, Josh wrote 10 tips which he refers to as rules of thumb when thinking in WPF. Read his post to get the details on each of the tips below.

  1. Do not hesitate to write code.
  2. Keep your XAML dumb.
  3. Keep visual resources out of value converters.
  4. Create modular value converters.
  5. Expose functionality as services, not subclasses.
  6. Think thrice before creating a custom control.
  7. Do not micromanage, let panels do the work.
  8. Carefully consider where to put resources.
  9. Strive for elegance, not eye candy.
  10. Avoid being a Blender.

As a creative developer, I have to disagree with tips 1, 2, and 10. With the power of triggers, transforms, control templates, and databinding, I like to make my XAML smart and write code only when it’s necessary. While it’s helpful to know how to perform functionality in code, it can be more beneficial to do it in XAML. A designer would have a hard time modifying the design if everything was done programmatic. Also functionality from procedural code cannot be changed in Expression Blend. Chris Idzerda has more details in his post Prefer descriptive code (e.g. XAML) to procedural code (e.g. C#). Funny enough, Chris’ WPF mantra is “don’t write code”.

Permalink Leave a Comment

Paul Stovell’s XAML and WPF Coding Guidelines

May 8, 2007 at 2:33 pm (Guidelines, Resources, Styles, WPF)

Paul Stovell has written an excellent post about XAML and WPF coding guidelines:

http://www.paulstovell.net/blog/index.php/xaml-and-wpf-coding-guidelines/

I think his section on structuring resources is specifically interesting. Family.Show’s AppStyles.xaml Resource Dictionary could’ve benefited from Paul’s advice. As we customized the look and feel of the application more and more, the AppStyles got bigger and disorganized.

Blend has Resources panel that shows all the resource dictionaries found in the current open project. By organizing the shared resources by types as Paul described, it would’ve made it easier to find the resources and maintain them.

However, I disagree with breaking out page specific resources into their own resource XAML file. Original I went down this path as well and it added more bloat to the project and the application more difficult to work with in Blend. I would keep the page/window specific resources in the .Resources section of the page/window.

Permalink Leave a Comment