blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

John Rayner's Blog

Brain.Extract<IBloggable>( Where.Author.Is( "John.Rayner" ) );

WPF/E: Running side-by-side with WPF Designer (a.k.a "Cider")

There are two main ways to develop WPF/E within Visual Studio 2005 - one is to edit the XAML in the XML Editor, and the other is to use Cider, the XAML WPF designer.  There are pros and cons to each approach, and some configuration for each.

Using Cider
CiderCider is the Visual Studio designer for WPF and XAML and is shown to the right.  It is available in CTP (there are no plans for an RTM version for VS 2005).  You can edit in a design view or a XAML view and they are synchronised.

This sounds great.  The only problem is that you have to be very careful to limit yourself to the WPF/E subset of XAML.  Cider targets the full set of XAML and WPF, so you may find that you end up developing something that doesn't work in WPF/E.  If you've developed anything with WPF/E, you'll know that the runtime errors are not particularly informative and so you might not want to go down this route.

Also, for Cider to work your XAML document needs to be in the namespace http://schemas.microsoft.com/winfx/2006/xaml/presentation. This isn't the WPF/E namespace.

 

 

Using the XML Editor
WPF/E IntellisenseI was very disappointed when I'd installed the WPF/E SDK and Visual Studio didn't give me Intellisense on my WPF/E XAML.  It turns out that this isn't very difficult to enable.  All you have to do is copy the file "wpfe.xsd" from the WPF/E SDK Schema directory into the Visual Studio schema directory.  In my case, I copied the file from

C:\Program Files\Microsoft SDKs\WPFE\Help\XSD 
   to   
C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas

These are the default directories so your system is likely to be the same.

It's worth noting that the default namespace on your XAML document needs to be http://schemas.microsoft.com/client/2007 for Visual Studio to associate the schema.  This is the proper WPF/E namespace.


Getting Visual Studio to Use the XML Editor
If you have installed Cider, you will find that Visual Studio wants to open all XAML documents using this and not using the XML editor.  If you do want to use the XML Editor, you need to inform Visual Studio of this.  To open XAML files in the XML editor by default you can go to the Tools / Options window and under Text Editor / File Extensions set .xaml files to open in the XML Editor.  A screenshot of this is below.  If you then want to open a XAML file in Cider, you will need to right-click from the Solution Explorer and choose "Open With ...".

And this is the other way of getting XAML files to open in the XML Editor (i.e. without modifying your options).  You can always right-click on your XAML file and go through the "Open With ..." dialog.  Personally, I prefer just to double-click.

Configuring Visual Studio to open XAML files in the XML editor

Published 08 December 2006 14:00 by john.rayner

Comments

 

John Rayner's Blog said:

So you&#39;ve installed the WPF/E runtime and played with a few samples . You&#39;ve probably also installed

December 8, 2006 15:59
 

Thomas Lebrun said:

Par défaut, lorsque vous développez un projet WPF /E ( Windows Presentation Foundation Everywhere ),

December 9, 2006 13:58
 

Andrew Stopford's Weblog said:

Another great post from John Rayner, this one is how to run WPF\E side by side with Cider . I am sure

December 12, 2006 09:35
 

Joycode@Ab110.com said:

1。[来源: Mike Harsh's Blog ] Mike Harsh 的 WPF/E ASP.NET 服务器控件 WPF/E ASP.NET Server Control http://blogs.msdn.com/mharsh/archive/2006/12/11/wpf-e-asp-net-server-control.aspx

December 14, 2006 18:01
 

JR's Agile Web 2.0 Blog said:

I&#39;ve caught the WPF/E (Windows Presentation Foundation / Everywhere ) buzz and so I decided to start

December 17, 2006 13:45
Anonymous comments are disabled
Powered by Community Server (Personal Edition), by Telligent Systems