Redigera

Dela via


IXamlSchemaContextProvider Interface

Definition

Represents a service that provides XAML schema context information to type converters and markup extensions.

public interface class IXamlSchemaContextProvider
public interface IXamlSchemaContextProvider
type IXamlSchemaContextProvider = interface
Public Interface IXamlSchemaContextProvider

Remarks

The IXamlSchemaContextProvider service provides one property, SchemaContext.

Use the IXamlSchemaContextProvider service and its SchemaContext property when you need the active XAML schema context from a markup extension or type converter implementation. Many XAML-related operations, most notably resolving a XAML type into its backing type for object graph creation, rely on having an available XAML schema context. However, for many scenarios, you can use the XAML schema context that is provided by a particular framework. Or you can use the default XAML schema context provided by .NET Framework XAML Services, which uses CLR and reflection backing and can provide the necessary XAML schema context for any CLR-defined type.

The IXamlSchemaContextProvider service is mainly relevant for implementations that anticipate that their value converter implementation might be called when it is supported by custom XAML schema contexts. You can get the service from the entry-point parameters of the virtual methods of TypeConverter or MarkupExtension that report service context. Or you can instead get the schema context directly from dedicated properties of specific XAML readers or XAML writers.

Properties

SchemaContext

Gets the XamlSchemaContext that is reported by the service context.

Applies to

See also