Dela via


How to: Deploy a Custom Control and Design-time Assemblies

You usually follow a similar workflow when you author design experiences for your custom WPF and Silverlight controls. This topic describes how to deploy your custom control and design-time assemblies.

Note

For examples that show how to implement custom design-time experiences, see WPF and Silverlight Designer Extensibility Samples.

Creating and Deploying Design-time Assemblies

To create and deploy design-time assemblies

  1. Implement your WPF or Silverlight control.

  2. Decide which versions of the WPF Designer framework your design-time implementation targets, and decide which designer tools will load your design-time assemblies. For example, you can target the 4.0 version of the WPF Designer framework and author design experiences that are specific to Visual Studio 2010 or later and Expression Blend 3 or later.

  3. Create corresponding projects for each of your design-time assemblies. Name the projects according to the convention described in Deploying a Custom Control and Design-time Assemblies. For example, the scenario in Step 2 could have projects with the following names.

    Naming Convention

    Description

    <ControlLibrary>.Design.4.0.dll

    Common design-time implementation.

    <ControlLibrary>.Expression.Design.4.0.dll

    Overrides the common design-time implementation with metadata specific to Expression Blend.

    <ControlLibrary>.VisualStudio.Design.4.0.dll

    Overrides the common design-time implementation with metadata specific to Visual Studio.

  4. Direct the build output of each design-time project to a common folder. This folder can be the same folder that contains your custom controls, or it can be a subfolder named Design.

  5. Add a class that implements the IProvideAttributeTable interface to each design-time project. This class is often named Metadata or RegisterMetadata. In this class, you specify the features implemented in your custom design-time. You also specify which classes appear in the Choose Items dialog box of the Toolbox.

  6. Apply the ProvideMetadataAttribute to each design-time assembly and use it to specify the corresponding RegisterMetadata class.

  7. Register your control and its associated design-time assemblies by using the AssemblyFoldersEx registration procedure. AssemblyFoldersEx is a registry location where third-party vendors store paths for each version of the framework that they support. Design-time resolution can look in this registry location to find reference assemblies. The registry script can specify the controls you want to appear in the Toolbox. For more information, see Deploying a Custom Control and Design-time Assemblies.

See Also

Reference

AttributeTable

ProvideMetadataAttribute

Concepts

Deploying a Custom Control and Design-time Assemblies

Providing Design-time Metadata

Other Resources

Visual Studio Extension Deployment

Understanding WPF Designer Extensibility

Basic Extensibility Concepts

WPF and Silverlight Designer Extensibility Samples