XamlType Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
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)
Parameters
- schemaContext
- XamlSchemaContext
XAML schema context for XAML readers or XAML writers.
Exceptions
One or more of underlyingType
or schemaContext
are null
.
Applies to
XamlType(String, IList<XamlType>, XamlSchemaContext)
Initializes a new instance of the XamlType class based on a string name for the type.
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)
Parameters
- typeName
- String
The name of the type to create.
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
XamlType(Type, XamlSchemaContext, XamlTypeInvoker)
Initializes a new instance of the XamlType class based on underlying type information and a XamlTypeInvoker implementation.
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)
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
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.
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)
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.
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.