How to: Add a Control to the Toolbox


The Silverlight Designer for Visual Studio makes it easy to use third-party controls in your Silverlight applications. This topic shows to add a control in a third-party assembly to the Toolbox and use it in a Silverlight application.

To use a third-party Silverlight control in your application

  1. Open the XAML file for your project's main window in the Silverlight Designer. For example, you might open MainPage.xaml or UserControl1.xaml.

  2. In the Toolbox, select the tab where you want to add the control.

  3. Right-click the Toolbox and select Choose Items from the shortcut menu.

    The Choose Toolbox Items dialog box opens. The following illustration shows the Choose Toolbox Items dialog box.

    Silverlight components tab
  4. Click the Silverlight Components tab.

  5. In the list, locate the control you want to use.

  6. If the control you want to use does not appear in the list, click the Browse button. In the Open dialog box, navigate to the assembly that contains the control you want to use. Select the assembly and click Open.

    Note Note:

    Assemblies and executables must be Silverlight assemblies and executables. If you attempt to add controls that are contained in assemblies that are not Silverlight assemblies or executables, a dialog box will appear that indicates there are no components to add to the Toolbox.

    Any controls contained in the assembly appear in the Choose Toolbox Items dialog box.

  7. Add a check mark next to the control you want to add, and then click OK.

    The selected control appears at the bottom of the selected tab in the Toolbox.

  8. From the Toolbox, drag the control onto the design surface.

    The selected control appears on the design surface. Also, the control's assembly is added as a project reference, and an XML namespace mapping is added to the XAML file.