Bewerken

Share via


TypeExtension Constructors

Definition

Initializes a new instance of the TypeExtension class.

Overloads

TypeExtension()

Initializes a new instance of the TypeExtension class.

TypeExtension(String)

Initializes a new instance of the TypeExtension class, initializing the TypeName value based on the provided typeName string.

TypeExtension(Type)

Initializes a new instance of the TypeExtension class, declaring the type directly.

TypeExtension()

Initializes a new instance of the TypeExtension class.

public:
 TypeExtension();
public TypeExtension ();
Public Sub New ()

Applies to

TypeExtension(String)

Initializes a new instance of the TypeExtension class, initializing the TypeName value based on the provided typeName string.

public:
 TypeExtension(System::String ^ typeName);
public TypeExtension (string typeName);
new System.Windows.Markup.TypeExtension : string -> System.Windows.Markup.TypeExtension
Public Sub New (typeName As String)

Parameters

typeName
String

A string that identifies the type to make a reference to. This string uses the format prefix:className. prefix is the mapping prefix for a XAML namespace, and is only required to reference types that are not mapped to the default XAML namespace.

Exceptions

Attempted to specify typeName as null.

Remarks

This value is not evaluated when you set it in the constructor. If the value is not null, the value will be initially accepted. The actual parsing and evaluation of the value is deferred until ProvideValue is called on this extension, when XAML is parsed and with available service contexts active. At this time the typeName is expected to be resolvable as a type within a XAML schema context, and that type is returned.

Applies to

TypeExtension(Type)

Initializes a new instance of the TypeExtension class, declaring the type directly.

public:
 TypeExtension(Type ^ type);
public TypeExtension (Type type);
new System.Windows.Markup.TypeExtension : Type -> System.Windows.Markup.TypeExtension
Public Sub New (type As Type)

Parameters

type
Type

The type to be represented by this TypeExtension.

Exceptions

type is null

Remarks

This is a helper method for run time code usages of TypeExtension and is not part of the normal implementation pattern for a markup extension.

Applies to