ContractBasedImportDefinition Constructor (String, String, IEnumerable<KeyValuePair<String, Type>>, ImportCardinality, Boolean, Boolean, CreationPolicy)

Initializes a new instance of the ContractBasedImportDefinition class with the specified contract name, required type identity, required metadata, cardinality, a value that indicates if the import definition is recomposable, a value that indicates if the import definition is a prerequisite, and a value that indicates the required creation policy.

Namespace:  System.ComponentModel.Composition.Primitives
Assembly:  System.ComponentModel.Composition (in System.ComponentModel.Composition.dll)


Public Sub New ( _
    contractName As String, _
    requiredTypeIdentity As String, _
    requiredMetadata As IEnumerable(Of KeyValuePair(Of String, Type)), _
    cardinality As ImportCardinality, _
    isRecomposable As Boolean, _
    isPrerequisite As Boolean, _
    requiredCreationPolicy As CreationPolicy _
public ContractBasedImportDefinition(
    string contractName,
    string requiredTypeIdentity,
    IEnumerable<KeyValuePair<string, Type>> requiredMetadata,
    ImportCardinality cardinality,
    bool isRecomposable,
    bool isPrerequisite,
    CreationPolicy requiredCreationPolicy


  • requiredTypeIdentity
    Type: System.String
    The type identity of the export type expected. Use the GetTypeIdentity method to generate a type identity for a given type. If no specific type is required, use nulla null reference (Nothing in Visual Basic).


Exception Condition

contractName is nulla null reference (Nothing in Visual Basic).


contractName is an empty string ("").


requiredMetadata contains an element that is nulla null reference (Nothing in Visual Basic).


cardinality is not one of the ImportCardinality values.

Version Information


Supported in: 5, 4


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.