IXamlSchemaContextProvider Interface

IXamlSchemaContextProvider Interface

.NET Framework 4.6 and 4.5

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

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

public interface IXamlSchemaContextProvider


Gets the XamlSchemaContext that is reported by the service context.

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.

.NET Framework
Available since 4.0
Return to top
© 2015 Microsoft