Import a custom control by adding a reference

As a designer, you might receive an assembly file (DLL) that contains a custom control that you have to use in your project. To be able to draw these kinds of controls on the artboard, you must first add a reference to the assembly.

To draw a custom control on the artboard

  1. On the Project menu, click Add Reference (ALT+SHIFT+R).

  2. In the Add Reference dialog box, browse to the DLL file that contains the custom control, and then click Open.

    In the Projects panel, under References, the DLL file appears in the list of default project references.

  3. Build your project (CTRL+SHIFT+B) to incorporate the classes from the DLL into your project.

  4. Open a XAML file on the artboard (such as MainPage.xaml) by double-clicking the name of the file in the Projects panel.

  5. Click Assets Dd185501.0d8b8d29-1af9-418f-8741-be3097d76eab(en-us,Expression.40).png in the Tools panel.

  6. In the Assets panel, click All under the Controls category, and then select your new control.


    Your new control appears underneath the Assets button in the Tools panel as the selected tool.

  7. Using your mouse, draw the custom control on the artboard.

    The control appears on the artboard and in the Objects and Timeline panel.

  8. Test your project (F5) to see the new control.

    tip noteTip

    As an alternative to adding a reference to a .dll file, you can add a reference to an uncompiled project. Add the project to your solution and then add the project reference to the first project. This is useful if you want to work on both projects at the same time in the same Expression Blend window. For more information, see Add a new or existing project to a solution.


  • If you cannot see the custom control displayed in the Project category of the Assets panel, try building the project.

  • After you draw your new control on the artboard, if it appears clipped, it might be because the control has default layout properties that are incompatible with the size of the control when you first drew it. With the new control selected in the Objects and Timeline panel, reset the Margin properties to 0 under Layout in the Properties panel, and then try to resize the control again.

See also

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.