views:

102

answers:

2

I want to be able to edit xaml in vs 2008 and be able to view the results without going crazy waiting for the wpf designer to draw the xaml.

I downloaded xamlpadx (v. 4) and kaxaml. They both look great, but it seems that they can only edit xaml without any custom namespaces. This makes it impossible for me because I'm using mvvm and am importing several namespaces in my xaml.

When I upload a typical xaml doc in kaxaml I get

like this:

<UserControl x:Class="SkipPro.View.ContactView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:m="clr-namespace:MVVMLibrary;assembly=MVVMLibrary"
    xmlns:tk="http://schemas.microsoft.com/wpf/2008/toolkit"
    Height="Auto" Width="Auto">
    <UserControl.Resources>
        <m:NotConverter x:Key="NotConverter"/>
        <m:VisibilityConverter x:Key="VisibilityConverter"/>
    </UserControl.Resources>

'Class' attribute does not exist in xaml namespace...

What are my choices?

+1  A: 

Expression Blend, I believe they have a "Free" or, at least, "Trial" version you can dl.

Muad'Dib
+1  A: 

Well, you have two options within Visual Studio 2008:

  1. Go to: Tools -> Options -> Text Editor -> XAML -> Miscellaneous and check Always open documents in full XAML view under Default View group. You can still switch to design view tab within editor.

  2. Open XAML documents with XML editor by default. Right click on a XAML document in Solution Explorer and click on Open With... in context menu. Select XML Editor or XML Editor with Encoding and click Set as Default button. From now on, XAML will be loaded without the WPF designer.

Edit: Here are few links with the tricks above:

http://karlshifflett.wordpress.com/2008/02/04/visual-studio-2008-tip-open-xaml-files-faster/

http://weblogs.asp.net/fmarguerie/archive/2009/01/29/life-changer-xaml-tip-for-visual-studio.aspx

Miroslav Popovic
#1 is one of the first things i do when working with a new VS install
qntmfred
qntmfred: if you like #1, try #2. It is perceptibly faster and more stable than the XAML view of the designer. And you can still switch into designer view if need be using the F7 combos or the right-click menu.
itowlson