XamlSchemaContext Class
Collapse the table of content
Expand the table of content

XamlSchemaContext Class

.NET Framework (current version)
 

Defines a reusable context for interpreting or mapping XAML types, and the types in the assemblies that underlie them.

Namespace:   System.Xaml
Assembly:  System.Xaml (in System.Xaml.dll)

System.Object
  System.Xaml.XamlSchemaContext

type XamlSchemaContext = class end

NameDescription
System_CAPS_pubmethodXamlSchemaContext()

Initializes a new instance of the XamlSchemaContext class.

System_CAPS_pubmethodXamlSchemaContext(IEnumerable<Assembly>)

Initializes a new instance of the XamlSchemaContext class, based on a set of reference assemblies.

System_CAPS_pubmethodXamlSchemaContext(IEnumerable<Assembly>, XamlSchemaContextSettings)

Initializes a new instance of the XamlSchemaContext class, based on a set of reference assemblies and a settings object.

System_CAPS_pubmethodXamlSchemaContext(XamlSchemaContextSettings)

Initializes a new instance of the XamlSchemaContext class, based on a settings object.

NameDescription
System_CAPS_pubpropertyFullyQualifyAssemblyNamesInClrNamespaces

Gets a value that specifies whether a XAML schema and its context use fully qualified assembly names in the values that are returned by the lookup API.

System_CAPS_pubpropertyReferenceAssemblies

Gets an enumerable set of reference assemblies for the XAML schema context.

System_CAPS_pubpropertySupportMarkupExtensionsWithDuplicateArity

Gets a value that specifies whether a XAML schema and its context support markup extensions that have two constructors with the same arity (number of input parameters).

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Provides a nonstandard Finalize implementation that does not invoke Dispose.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetAllXamlNamespaces()

Searches the assemblies that are held by this XamlSchemaContext and returns a set of namespaces.

System_CAPS_pubmethodGetAllXamlTypes(String)

Searches the assemblies that are held by this XamlSchemaContext and returns a set of types from the specified XAML namespace.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetPreferredPrefix(String)

Gets a string that is reported as the preferred prefix for consumers to use when they map the specified XAML namespace.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodGetValueConverter<'TConverterBase>(Type, XamlType)

Returns a value converter that can convert to the requested targetType.

System_CAPS_pubmethodGetXamlDirective(String, String)

Returns a XamlDirective value that represents a directive, either for the XAML language or for a particular implementation.

System_CAPS_protmethodGetXamlType(String, String, XamlType[])

Returns a XamlType that is based on a XAML namespace and a string for the type name. This signature can specify the type arguments for cases where the desired type is a generic type.

System_CAPS_pubmethodGetXamlType(Type)

Returns a XamlType that is based on a CLR type identifier.

System_CAPS_pubmethodGetXamlType(XamlTypeName)

Returns a XamlType that is based on a XAML system type name.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodOnAssemblyResolve(String)

Called when operations use this schema context to resolve an assembly that is required in order to resolve the XAML namespaces that it contains.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodTryGetCompatibleXamlNamespace(String, String)

Returns the success or failure of a request for a compatible XAML namespace. A successful request reports that XAML namespace as an out parameter.

A XAML schema context provides a layer of abstraction between a schema or vocabulary for XAML, and a specific parser implementation. By inserting the concept of a schema context, the schema can be used with different XAML parsers, and the schema context fills in the details that are needed to interact with a specific XAML parser. For example, the XAML schema context provides query APIs that relate to XAML concepts or to the CLR binding to the XAML type system. The XAML schema context is also responsible for maintaining the assembly list of loaded assemblies, which defines where a XAML parser looks for backing types.

Notes to Implementers:

In an AppDomain, a XamlSchemaContext can be shared between multiple callers, which include both full and partial trust callers. This situation exists in frameworks such as WPF, which provide partial-trust access to XAML loading for portions of the WPF application model. The default XamlSchemaContext implementation provides safeguards in this scenario by keeping all its properties and settings immutable. Derived implementations should also consider following this model of immutability for properties and settings of a XAML schema context.

The XamlSchemaContext base class is designed so that lookups have no externally observable side effects. The types that are referenced by XamlSchemaContext APIs in the base class, such as XamlType or XamlMember, also produce no side effects from lookups. All data that is needed to make a schema determination should be available from the construction and settings of the AppDomain. Notice that no lookup APIs rely on explicitly passed-in services; their input relies on string input only.

The XamlSchemaContext base class, and XamlType and XamlMember are all thread safe in their base implementations. If you derive from XamlSchemaContext or derive XAML type system classes such as XamlType and XamlMember , you can choose whether your classes will behave as thread safe.

.NET Framework
Available since 4.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft