IXamlTypeResolver 接口

定义

表示一种服务,该服务将 XAML 标记中的已命名元素解析为适当的 CLR 类型。Represents a service that resolves from named elements in XAML markup to the appropriate CLR type.

public interface class IXamlTypeResolver
public interface IXamlTypeResolver
type IXamlTypeResolver = interface
Public Interface IXamlTypeResolver

注解

类主要由TypeConverterMarkupExtension作者用作服务, 以确定构造 clr 对象所需的 XAML 到 CLR 类型映射。 IXamlTypeResolverThe IXamlTypeResolver class is used primarily by TypeConverter and MarkupExtension authors as a service to determine the XAML-to-CLR type mapping that is necessary for constructing a CLR object.

当 xaml 对象编写器调用值转换IXamlTypeResolver行为时, 类型转换器和标记扩展可以在 xaml 对象编写器提供的服务上下文上查询为服务。Type converters and markup extensions can query for IXamlTypeResolver as a service on the service context that is provided by a XAML object writer, when the XAML object writer invokes value conversion behavior. 有关详细信息, 请参阅可用于类型转换器和标记扩展的 XAML 的类型转换器和标记扩展For more information, see Type Converters and Markup Extensions for XAML and Service Contexts Available to Type Converters and Markup Extensions.

在 .NET Framework 的以前版本中, 此接口存在于 WPF 特定的程序集 WindowsBase 中。In previous versions of the .NET Framework, this interface existed in the WPF-specific assembly WindowsBase. .NET Framework 4.NET Framework 4IXamlTypeResolver , 为 system.exception 程序集。In .NET Framework 4.NET Framework 4, IXamlTypeResolver is in the System.Xaml assembly. 有关详细信息,请参阅 Types Migrated from WPF to System.XamlFor more information, see Types Migrated from WPF to System.Xaml.

方法

Resolve(String)

将已命名的 XAML 类型解析为相应的 CLR TypeResolves a named XAML type to the corresponding CLR Type.

适用于

另请参阅