Getting Silverlight XAML Intellisense in VS2008

bad intellisense

I've gotten the question a number of times about problems getting intellisense with Visual Studio 2008. If your XAML looks like this in Visual Studio 2008 then I can help you:

 

 

 

 

right click menu

The problem stems from the fact that VS2008 wants to open .xaml files in the WPF Designer. Instead you can get intellisense and a better-faster experience if you open your Silverlight XAML files in the XML Editor.  Most people assume that the intellisense is the lack of the Silverlight XSD file in the installation, but in fact VS2008 includes the Silverlight XSD document (but is unaptly named WPFE.XSD). To solve the problem of opening the file in th wrong editor, right click your XAML file in the solution explorer and pick "Open With..." (see right).

 

 

 

Open With... Dialog

Once that dialog is open, you can pick the "XML Editor" and it will open the file with full intellisense.  I usually click the "Set Default" button as well to always open XAML files (for both WPF and Silverlight) in the XML editor.  I use Blend to edit these files and I am not a big fan of the built-in editor (as it seems to be designed mostly for Windows Forms developers to create simple experiences.  You can see the "Open With..." dialog below:

Let me know if you have any questions!

Comments:

Gravatar

Thanks again for this info.

Gravatar

If I do as you say .. I loose intellisense ? is there a way to fix it ?

/Bo

Gravatar

Bo,

This is old info. Make sure you're opening your XAML files with the XAML editor (not the XML editor) and you'll get intellisense.

Gravatar

Where is the XAML Editor? The only options I get are: XML Editor (Default), XML Editor with Encoding, Source Code (Text) editor [and with encoding], HTML Editor [and with encoding], Notepad, Binary Editor, and Resource Editor

Gravatar

DKermott,

This is no longer an option. You must use their XAML editor. If you aren't getting XAML editor, you may not have the Silverlight 2 Tools installed.

Gravatar

Also...
If I click on Tools->Options->Text Editor->XAML->Formatting I get the message "an error occurred loading this property page"
Help, Mr. Wizard!

Gravatar

DKermott,

Sounds like you have a bad installation of the Silverlight 2 tools. I would uninstall the tools, the sdk and the silverlight runtime and re-install the setup package (it installs all three).

Gravatar

the solution elsewhere:

http://forums.msdn.microsoft.com/en-US/vswpfdesigner/thread/053dc5c3-27fe-4ea2-a7f5-5c6cf35000bb/

Opening the Start->Run command and entering "devenv /resetskippkgs" was all it took!

Gravatar

What about the XAML-specific commands in JavaScript? It would be nice if Intellisense would suggest i.e. "findName" when i write "sender.". Is there a solution?

Gravatar

Daniel,

What do you mean XAML specific commands in JavaScript?

Gravatar

I would like to have the attribute names and the method names of XAML elements like Canvas, Rectangle etc. For example if I write 'sender.' in an event handler function, intellisense should deliver 'findName' as a regular method of the sender. If the sender is a Rectangle, Intellisense should furthermore show 'Stroke' an so on.
I found a complete Intellisense Javascript Toolkit for Silverlight 1 on this site: http://blogs.microsoft.co.il/blogs/justinangel/archive/2007/08/01/Silverlight-1.0-full-Javascript-Intellisense.aspx.
Probably it's the only way solving my issue.

Gravatar

goryny4 - You are the Man! Thanks for the great tip! Works like a charm! Thanks again..

Gravatar

I still have problem:( I have VS 2008 professional and silverlight 3

Gravatar

I still have problem:( I have VS 2008 professional and silverlight 3

Gravatar

GORNY4 rules! that start>run thing was all I needed! woot!

Gravatar

I used run devenv /resetskippkgs
then i source code text editor as default.
to get it working

Gravatar

this was really helpful... Thanks a lot


 



 
Save Cancel