8.1.08

Visual Studio 2008 as a WPF editor

I've started learning WPF and writing XAML in Visual Studio 2008. Granted, I've haven't used any other editors like Expression Blend, but I find VS2008 extremely lacking, in both the visual editor and the text editor.

I never liked using Visual Studio's (2003 and 2005) visual web page editor either. It never really created the HTML the way I wanted, and it tended to destroy my beautifully-indented and formatted markup. Moreover, once you start doing complex Ajax events, everything falls to pieces. But the real problem is handling CSS.

The WPF editor is terrible for essentially the same reason--it's trying to model the old-school absolute positioning in a language which is designed to be non-absolute. You can drag and drop all of your elements onto a window, but they get ridiculous margins. Instead, you need to add some StackPanels, DockPanels, and so forth. Can you do this with the editor? Yes. Is it easier by hand? Yes.

Then my second complaint is that the Intellisense sucks. It works for most elements and attributes, but there is no popup documentation provided inline, like it is for C# and ASP. And the Intellisense just don't work for anything in strings.

<Button Margin="0,0,3,0" Content="{Binding Foo.Bar}" />


It doesn't inform you that Binding is possible inside the brace. It will actually color-code the first thing you type in a brace, regardless of whether it's actually valid. Secondly, this will only work if the DataContext for the Button (or its parent) has a Foo property, and if that Foo property has a Bar property. You will get a nice compile-time error if that's not the case, BUT I would really appreciate a nice intellisense list so I didn't spend half my time looking up class definitions.

I'm really liking WPF's model, and it only gets more interesting as I learn more. However, I wish the tool was a little more advanced so that it could actually enable me.

No comments: