Čítať v angličtine Upraviť

Zdieľať cez


XamlType Constructors

Definition

Initializes a new instance of the XamlType class.

Overloads

XamlType(Type, XamlSchemaContext)

Initializes a new instance of the XamlType class based on the underlying CLR type information.

XamlType(String, IList<XamlType>, XamlSchemaContext)

Initializes a new instance of the XamlType class based on a string name for the type.

XamlType(Type, XamlSchemaContext, XamlTypeInvoker)

Initializes a new instance of the XamlType class based on underlying type information and a XamlTypeInvoker implementation.

XamlType(String, String, IList<XamlType>, XamlSchemaContext)

Initializes a new instance of the XamlType class based on the XAML namespace and a string name for the type. This constructor is exclusively for analysis and XAML-node recording of type usages that are known to not have backing in the supporting type system and XAML schema context.

XamlType(Type, XamlSchemaContext)

Initializes a new instance of the XamlType class based on the underlying CLR type information.

C#
public XamlType(Type underlyingType, System.Xaml.XamlSchemaContext schemaContext);

Parameters

underlyingType
Type

The underlying CLR Type for the XAML type to construct.

schemaContext
XamlSchemaContext

XAML schema context for XAML readers or XAML writers.

Exceptions

One or more of underlyingType or schemaContext are null.

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlType(String, IList<XamlType>, XamlSchemaContext)

Initializes a new instance of the XamlType class based on a string name for the type.

C#
protected XamlType(string typeName, System.Collections.Generic.IList<System.Xaml.XamlType> typeArguments, System.Xaml.XamlSchemaContext schemaContext);

Parameters

typeName
String

The name of the type to create.

typeArguments
IList<XamlType>

The type arguments for a XamlType that represents a generic type. Can be (and often is) null, which indicates that the represented type is not a generic type.

schemaContext
XamlSchemaContext

XAML schema context for XAML readers and XAML writers.

Exceptions

One or more of typeName or schemaContext are null.

Remarks

This is a protected constructor. No current public derived classes exist that use this particular path for construction. As a consumer of the existing XamlType, you must use the other constructor signatures (XamlType(Type, XamlSchemaContext, XamlTypeInvoker), XamlType(Type, XamlSchemaContext), or XamlType(String, String, IList<XamlType>, XamlSchemaContext)) to initialize a XamlType object.

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlType(Type, XamlSchemaContext, XamlTypeInvoker)

Initializes a new instance of the XamlType class based on underlying type information and a XamlTypeInvoker implementation.

C#
public XamlType(Type underlyingType, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlTypeInvoker invoker);

Parameters

underlyingType
Type

The underlying type for the XAML type to construct.

schemaContext
XamlSchemaContext

XAML schema context for the XAML reader.

invoker
XamlTypeInvoker

The XamlTypeInvoker implementation that handles run-time reflection calls against the XamlType.

Exceptions

One or more of underlyingType or schemaContext are null.

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlType(String, String, IList<XamlType>, XamlSchemaContext)

Initializes a new instance of the XamlType class based on the XAML namespace and a string name for the type. This constructor is exclusively for analysis and XAML-node recording of type usages that are known to not have backing in the supporting type system and XAML schema context.

C#
public XamlType(string unknownTypeNamespace, string unknownTypeName, System.Collections.Generic.IList<System.Xaml.XamlType> typeArguments, System.Xaml.XamlSchemaContext schemaContext);

Parameters

unknownTypeNamespace
String

The XAML namespace for the type, as a string.

unknownTypeName
String

The name of the type in the provided unknownTypeNamespace XAML namespace.

typeArguments
IList<XamlType>

The type arguments for a XamlType that represents a generic type. Can be (and often is) null, which indicates that the represented type is not a generic type.

schemaContext
XamlSchemaContext

XAML schema context for XAML readers or XAML writers.

Exceptions

One or more of unknownTypeNamespace, unknownTypeName, or schemaContext are null.

Remarks

Use this constructor only for "unknown" types where a XAML type that maps to an underlying type system is unavailable. This constructor might not produce a result where XamlType.IsUnknown is true. Instead, the default reflector logic reports the underlying type as XamlLanguage.Object. However, this behavior can change because of the LookupIsUnknown override.

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10