Share via


ReflectionModelServices.CreatePartDefinition Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Creates a part definition with the specified part type, imports, exports, metadata, and origin.

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

Syntax

'Declaration
Public Shared Function CreatePartDefinition ( _
    partType As Lazy(Of Type), _
    isDisposalRequired As Boolean, _
    imports As Lazy(Of IEnumerable(Of ImportDefinition)), _
    exports As Lazy(Of IEnumerable(Of ExportDefinition)), _
    metadata As Lazy(Of IDictionary(Of String, Object)), _
    origin As ICompositionElement _
) As ComposablePartDefinition
public static ComposablePartDefinition CreatePartDefinition(
    Lazy<Type> partType,
    bool isDisposalRequired,
    Lazy<IEnumerable<ImportDefinition>> imports,
    Lazy<IEnumerable<ExportDefinition>> exports,
    Lazy<IDictionary<string, Object>> metadata,
    ICompositionElement origin
)

Parameters

  • isDisposalRequired
    Type: System.Boolean
    true if the part requires disposal; otherwise, false.

Return Value

Type: System.ComponentModel.Composition.Primitives.ComposablePartDefinition
A part definition created from the specified parameters.

Version Information

Silverlight

Supported in: 5, 4

Platforms

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