Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The referenced component 'Microsoft.Phone.Controls.Toolkit' could not be found?

The referenced component 'Microsoft.Phone.Controls.Toolkit' could not be found?

It's here though?

enter image description here

like image 736
AlexDuncan Avatar asked Dec 17 '22 02:12

AlexDuncan


2 Answers

It looks like the problem is that you're trying to reference a copy of the Microsoft.Phone.Controls.Toolkit .dll in your Ref folder, but Visual Studio is probably looking for somewhere else.

If you open Visual Studio and expand the References folder in the Solution Explorer, you'll probably see that Microsoft.Phone.Controls.Toolkit is listed but marked with a yellow warning icon.

Try right clicking that and clicking Remove. Then right click on References, browse to file in your Ref folder, and re-add it.

Update: The ListPicker is a control in the Silverlight Toolkit for Windows Phone, which is an add in set of controls published by Microsoft. That's the reference you just added back into your app.

When you add a control to the page, you need to add a reference to the .dll to the XAML page and map it to a prefix that will tell Visual Studio where to find the control:

<phone:PhoneApplicationPage x:Class="MyApp.MainPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit">

Note the toolkit prefix.

Now you can add a control like this:

<toolkit:ListPicker></toolkit:ListPicker>

If those items are set up correctly, you might also need to check if the .dll was "blocked" when you downloaded it. Browse to the .dll in Explorer, then right click and look at the bottom for a button called Unblock. If it's there, click it.

The references in the XAML can be tricky to set up. There's a sample app available for the toolkit that can be helpful.

like image 87
Josh Earl Avatar answered May 16 '23 06:05

Josh Earl


You can install Nuget and use it to install the Toolkit. Add the Toolkit to your project by following the steps below;

  • In Visual Studio go to the Tools menu
  • Select Library Package Manager
  • Open the Package Manager Console
  • Type PM> install-package WPToolkit

This will install and add the toolkit to your project.

Find the full article here

like image 42
desw Avatar answered May 16 '23 06:05

desw