2
votes

I'm going mental with WP7 toolkit import. I've already read a lot of similar questions but nothing seems to work.

I'm trying to using the WP7 toolkit for a 7.1 project with Microsoft Visual Studio 2010 express for windows Phone.

Everything seems to be pretty simple, I followed all the instructions: http://www.codebadger.com/blog/post/2010/11/01/WP7-Tip-of-the-Day-Silverlight-Toolkit-Gestures.aspx

so, what I have now is

DashBoard.xaml

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"

DashBoard.xaml.cs

using Microsoft.Phone.Shell;
using Microsoft.Phone.Controls.Toolkit;

Of course I've installed the Silverlight for Windows Phone Toolkit - Nov 2011.msi downloaded here http://silverlight.codeplex.com/releases/view/75888

And I added the reference by right-clicking on Reference -> Add Reference and and added the dll I've found at

C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Toolkit\Oct11\Bin

but I still have the error mentioned in the title

The type or namespace name 'Toolkit' does not exist in the namespace 'Microsoft.Phone.Controls' (are you missing an assembly reference?)

does anyone know how to make it work?

2
Have you tried to Rebuild? It's often an easy fix for problems like that.Kris Selbekk
I've just tried to rebuild but nothing has changed.oroblam

2 Answers

3
votes

"using Microsoft.Phone.Controls.Toolkit" is not possible. In order to use toolkit controls in your code behind "using Microsoft.Phone.Controls" is sufficient.

But you can definitely do

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"

and using this create controls in you xaml page as follows:

  <toolkit:ListPicker></toolkit:ListPicker>
0
votes

Use NuGet!

When you use NuGet to install a package, it copies the library files to your solution and automatically updates your project (add references, change config files, etc.). If you remove a package, NuGet reverses whatever changes it made so that no clutter is left.

Silverlight for Windows Phone toolkit is downloadable here.

If you're wondering how to install and use NuGet, read more about it here.