Most WPF and Silverlight devs already know to turn off the default design view for XAML. I don’t ever use the designer in Visual Studio for either Silverlight or WPF. My apologies to the team that worked on it, but it is a hindrance and not a help. When I give presentations, my audiences are often surprised to discover how much XAML I edit manually. Now, I do use both Blend and Kaxaml quite a bit, but never the builtin designer.
In case you don’t know how to disable the design view (the option is buried somewhat):
Tools > Options > Text Editor > XAML > Miscellaneous
Then check “Always open documents in full XAML view”
I upgraded to 64-bit Vista a month or so back, and despite the positive experience overall, I had one very frustrating problem. Frequently, when I worked with a XAML file, Visual Studio would get all wonky. It only seemed to affect a single XAML file at a time, even if I had a dozen open. I could reset the troubled file by closing it and opening it again. The problem usually started with my scrollbar failing to repaint. At first I was fearful that it might be related to ReSharper (which has awesome XAML features BTW). Then I suspected my video drivers (which I still do actually). Nevertheless, I didn’t find a solution.
Fortunately, Fabrice Marquerie (of LINQ in Action fame) made this very useful post on his site a few days.
Fabrice discovered an excellent trick: using the Source Code Editor for XAML. It’s really fast and you have all of the same features as the default XAML editor. The only thing you lose it the Design tab at the bottom. And hey, if you really need it, it’s only a right-click away!
Here’s the instructions copied from his blog:
- Right-click on a XAML file in the Solution Explorer
- Select "Open With..."
- Select "Source Code (Text) Editor"
- Click on "Set as Default"
- Click OK
- You're done!
Trust me, if you work with XAML, you’ll want to do this.
02-04-2009 9:51 AM