The XAML editor in Visual Studio 2008 is much improved over the 2005 Extensions version. Let’s take a look as some of the preferences you can change in the Tools/Options dialog.
Full XAML view
I like working in the XAML editor in Visual Studio. Most of time if I want a WSYWIG editor I’ll use Expression Blend. I’ll have to see if I like Visual Studios WPF Designer better now that it has shipped. I do know that the XAML editor in VS is considerably better than the Blend editor. That means I tend to write most of my XAML in VS.
I’m happy to see the new “Always open documents in full XAML view” option. Check this option and your WPF windows (including new files) always open in XAML view. Glorious!
The other two checkboxes on the XAML/Miscellaneous screen are fairly self explanatory.
Closing Tags: When you finish typing the opening XAML element VS will automatically add the closing element. Just like the VS XML editor. Frankly, I can’t conceive turning off this setting as it saves so much typing.
Attribute Quotes: Automatically insert two quotes “” and place the cursor between the begin and end quote. Visual Studio has a some quirky behavior here though depending on whether you use TAB or = to complete your attribute value.
When you type the complete attribute (example, Background) and then type the = character VS examines your preference and auto inserts the quotes. This only happens if you type the complete word and then =.
When you type a few letters of the attribute (example, bac) , see the Intellisense drop-down showing your desired attribute name, and you press TAB Visual Studio ignores your preference and inserts everything (example Background=””).
I usually use TAB or the CodeRush shortcuts to enter my values as it is much faster than typing the whole attribute name. For this setting I leave it checked.
To follow along with this example you need to have the final version (RTM) of Visual Studio 2008 installed. Find trial versions here.