When speaking to people just getting started writing WPF applications, I get asked a lot why intellisense does not work all the time. So here is the low down for anyone having this problem:
At first, this seemed to happen randomly. However I have determined why it seemed to be random and what was causing the loss of intellisense. By default, when you create a new WPF project in Visual Studio 2005, you are given a WPF Window file called Window1.xaml. This file looks something like this
<Window x:Class="WindowsApplication18.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/ presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WindowsApplication18" Height="300" Width="300" > <Grid> </Grid> </Window>
Note the Grid block colored red! Sometimes I will delete this grid block before adding the panel type I want to use. Other times, I will add the panel I want to use and then delete the grid block.
It appears that if you delete the grid block first before making any other modifications to the file or before adding another panel block, the presentation schema is removed from the Schemas list in the project properties.
The Schemas list is located in the project properties. Click on the project in the Solution Explorer then look in the Properties tab. You will see an item labled Schemas. If you click on the ellipses in the Schemas selection box, you will see a window like this: Make sure that you have selected both Xaml2006.xsd and XamlPresentation2006.xsd.
So bottom line is if you have lost intellisense in your WPF project, check the list of schemas associated with your project. More than likely, the XamlPresentation2006.xsd has been removed!