Click or drag to resize

ImportExtension Class

The XAML equivalent of the ImportAttribute. Use like the StaticExtension; uses the MEF ExportProvider to create the object.
Inheritance Hierarchy

Namespace:  TomsToolbox.Wpf.Composition
Assembly:  TomsToolbox.Wpf (in TomsToolbox.Wpf.dll) Version: 1.0.74.0
Syntax
[MarkupExtensionReturnTypeAttribute(typeof(Object))]
public class ImportExtension : MarkupExtension

The ImportExtension type exposes the following members.

Constructors
  NameDescription
Public methodImportExtension
Initializes a new instance of the ImportExtension class.
Top
Properties
  NameDescription
Public propertyAllowRecomposition
Gets or sets a value indicating whether recomposition is enabled when the container changes, just like AllowRecomposition.
Public propertyContractName
Gets or sets the optional contract name of the exported object.

[CanBeNull]

Public propertyMemberType
Gets or sets the exported type of the object to provide.

[NotNull]

Public propertySetters
Gets a list of setters that allow initializing dependency properties of the composed object.

[NotNull, ItemNotNull]

Top
Methods
  NameDescription
Public methodProvideValue
When implemented in a derived class, returns an object that is provided as the value of the target property for this markup extension.
(Overrides MarkupExtensionProvideValue(IServiceProvider).)
Top
Extension Methods
  NameDescription
Public Extension MethodSafeCastT
Performs a cast from object to T, avoiding possible null violations if T is a value type.

[CanBeNull]

(Defined by ObjectExtensions.)
Top
See Also