Share via


Adding Panorama and Pivot Controls to the Toolbox in Visual Studio (speeding development 1 second at a time)

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.

image

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:

  • Display the Toolbox
  • Right-click and select Choose Items…. The following image shows an example.

      image

  • The Choose Toolbox Items dialog appears, and the Windows Phone Components tab should be selected. If not, select it.
  • Scroll until you locate the Panorama and Pivot controls and check them. Again, see the following image for an example:

     image

  • Check any other controls you would like in the Toolbox. For example, if you have the Toolkit installed, you can add controls such as the ListPicker.

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!

--Cheryl

Comments

  • Anonymous
    March 29, 2012
    Thx !