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
- partType
Type: System.Lazy<Type>
The type of the part.
- isDisposalRequired
Type: System.Boolean
true if the part requires disposal; otherwise, false.
- imports
Type: System.Lazy<IEnumerable<ImportDefinition>>
A collection of the part's imports.
- exports
Type: System.Lazy<IEnumerable<ExportDefinition>>
A collection of the part's exports.
- metadata
Type: System.Lazy<IDictionary<String, Object>>
The part's metadata.
- origin
Type: System.ComponentModel.Composition.Primitives.ICompositionElement
The part's origin.
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.