通过


XamlType 构造函数

定义

初始化 XamlType 类的新实例。

重载

名称 说明
XamlType(Type, XamlSchemaContext)

基于基础 CLR 类型信息初始化类的新实例 XamlType

XamlType(String, IList<XamlType>, XamlSchemaContext)

根据类型的字符串名称初始化类的新实例 XamlType

XamlType(Type, XamlSchemaContext, XamlTypeInvoker)

基于基础类型信息和XamlTypeInvoker实现初始化类的新实例XamlType

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

基于 XAML 命名空间和类型的字符串名称初始化类的新实例 XamlType 。 此构造函数专门用于分析和 XAML 节点记录类型用法,这些用法已知在支持类型系统和 XAML 架构上下文中没有支持。

XamlType(Type, XamlSchemaContext)

基于基础 CLR 类型信息初始化类的新实例 XamlType

public:
 XamlType(Type ^ underlyingType, System::Xaml::XamlSchemaContext ^ schemaContext);
public XamlType(Type underlyingType, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlType : Type * System.Xaml.XamlSchemaContext -> System.Xaml.XamlType
Public Sub New (underlyingType As Type, schemaContext As XamlSchemaContext)

参数

underlyingType
Type

要构造的 XAML 类型的基础 CLR Type

schemaContext
XamlSchemaContext

XAML 读取器或 XAML 编写器的 XAML 架构上下文。

例外

一个或多个underlyingTypeschemaContext或为 null

适用于

XamlType(String, IList<XamlType>, XamlSchemaContext)

根据类型的字符串名称初始化类的新实例 XamlType

protected:
 XamlType(System::String ^ typeName, System::Collections::Generic::IList<System::Xaml::XamlType ^> ^ typeArguments, System::Xaml::XamlSchemaContext ^ schemaContext);
protected XamlType(string typeName, System.Collections.Generic.IList<System.Xaml.XamlType> typeArguments, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlType : string * System.Collections.Generic.IList<System.Xaml.XamlType> * System.Xaml.XamlSchemaContext -> System.Xaml.XamlType
Protected Sub New (typeName As String, typeArguments As IList(Of XamlType), schemaContext As XamlSchemaContext)

参数

typeName
String

要创建的类型的名称。

typeArguments
IList<XamlType>

表示泛型类型的类型参数 XamlType 。 可以是(通常为) null,指示表示的类型不是泛型类型。

schemaContext
XamlSchemaContext

XAML 读取器和 XAML 编写器的 XAML 架构上下文。

例外

一个或多个typeNameschemaContext或为 null

注解

这是受保护的构造函数。 不存在使用此特定路径进行构造的当前公共派生类。 作为现有XamlType构造函数的使用者,必须使用其他构造函数签名(XamlType(Type, XamlSchemaContext, XamlTypeInvoker)XamlType(Type, XamlSchemaContext)XamlType(String, String, IList<XamlType>, XamlSchemaContext))来初始化XamlType对象。

适用于

XamlType(Type, XamlSchemaContext, XamlTypeInvoker)

基于基础类型信息和XamlTypeInvoker实现初始化类的新实例XamlType

public:
 XamlType(Type ^ underlyingType, System::Xaml::XamlSchemaContext ^ schemaContext, System::Xaml::Schema::XamlTypeInvoker ^ invoker);
public XamlType(Type underlyingType, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlTypeInvoker invoker);
new System.Xaml.XamlType : Type * System.Xaml.XamlSchemaContext * System.Xaml.Schema.XamlTypeInvoker -> System.Xaml.XamlType
Public Sub New (underlyingType As Type, schemaContext As XamlSchemaContext, invoker As XamlTypeInvoker)

参数

underlyingType
Type

要构造的 XAML 类型的基础类型。

schemaContext
XamlSchemaContext

XAML 读取器的 XAML 架构上下文。

invoker
XamlTypeInvoker

处理 XamlTypeInvoker 针对该调用的运行时反射调用的 XamlType实现。

例外

一个或多个underlyingTypeschemaContext或为 null

适用于

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

基于 XAML 命名空间和类型的字符串名称初始化类的新实例 XamlType 。 此构造函数专门用于分析和 XAML 节点记录类型用法,这些用法已知在支持类型系统和 XAML 架构上下文中没有支持。

public:
 XamlType(System::String ^ unknownTypeNamespace, System::String ^ unknownTypeName, System::Collections::Generic::IList<System::Xaml::XamlType ^> ^ typeArguments, System::Xaml::XamlSchemaContext ^ schemaContext);
public XamlType(string unknownTypeNamespace, string unknownTypeName, System.Collections.Generic.IList<System.Xaml.XamlType> typeArguments, System.Xaml.XamlSchemaContext schemaContext);
new System.Xaml.XamlType : string * string * System.Collections.Generic.IList<System.Xaml.XamlType> * System.Xaml.XamlSchemaContext -> System.Xaml.XamlType
Public Sub New (unknownTypeNamespace As String, unknownTypeName As String, typeArguments As IList(Of XamlType), schemaContext As XamlSchemaContext)

参数

unknownTypeNamespace
String

类型的 XAML 命名空间,作为字符串。

unknownTypeName
String

提供的 unknownTypeNamespace XAML 命名空间中类型的名称。

typeArguments
IList<XamlType>

表示泛型类型的类型参数 XamlType 。 可以是(通常为) null,指示表示的类型不是泛型类型。

schemaContext
XamlSchemaContext

XAML 读取器或 XAML 编写器的 XAML 架构上下文。

例外

unknownTypeNamespace个或多个, unknownTypeNameschemaContextnull

注解

仅将此构造函数用于映射到基础类型系统的 XAML 类型不可用的“未知”类型。 此构造函数可能不会生成结果,其中 XamlType.IsUnknowntrue 相反,默认反射器逻辑将基础类型报告为 XamlLanguage.Object。 但是,由于重写,此行为可能会更改 LookupIsUnknown

适用于