So I started work on a sample today and decided I wanted to use a Pivot control. I created a new project in Visual Studio and looked for the Pivot control in the Toolbox, but didn’t find it. In the XAML editor I tried typing <phone:…and got Intellisense that suggested a Page, Frame or WebBrowser control, but I still did not see the Panorama or Pivot controls. I was a bit puzzled, but I haven’t used these controls in awhile, so I looked up Pivot in the reference documentation. I saw that Pivot (and Panorama) are in the Microsoft.Phone.Controls namespace in the Microsoft.Phone.Controls assembly.
Because this assembly reference is not added by default to the Windows Phone project, in order to use these controls, I would need to add a reference to this assembly and then map the namespace/assembly in XAML.
Then I had a better idea. Why not add them to the Toolbox? Then I would get the reference and namespace mapping for free. So that’s what I did, and here’s how you can do it too.
To add a new control to the Toolbox:
Now you can drag and drop the Panorama and Pivot controls from the Toolbox to the design surface, and you’ll get the necessary references and namespace mappings for free. Development just got faster!