IXamlNamespaceResolver 接口

定义

描述一个服务,该服务可按照 XAML 标记中映射的方式基于 XAML 命名空间的前缀返回该命名空间。Describes a service that can return a XAML namespace that is based on its prefix as it is mapped in XAML markup.

public interface class IXamlNamespaceResolver
public interface IXamlNamespaceResolver
type IXamlNamespaceResolver = interface
Public Interface IXamlNamespaceResolver
派生

注解

当 xaml 对象编写器调用值转换IXamlNamespaceResolver行为时, 类型转换器和标记扩展可以在 xaml 对象编写器提供的服务上下文上查询为服务。Type converters and markup extensions can query for IXamlNamespaceResolver 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.

WPF 用法说明WPF Usage Notes

此接口还作为XmlnsDictionary类中 WPF XAML 实现的一部分实现。This interface is also implemented as part of the WPF XAML implementation in the XmlnsDictionary class. XmlnsDictionary存储 xaml 命名空间信息并与 xaml 处理器进行交互, 以便通过相同IXamlTypeResolver的接口将该信息转发到服务上下文。XmlnsDictionary stores XAML namespace information and interacts with XAML processors to forward that information to the service context through the same IXamlTypeResolver interface.

方法

GetNamespace(String)

针对指定的前缀字符串检索 XAML 命名空间标识符。Retrieves a XAML namespace identifier for the specified prefix string.

GetNamespacePrefixes()

返回所有可能的前缀到 XAML 命名空间映射(NamespaceDeclaration 值),这些映射可在活动架构上下文中找到。Returns all the possible prefix-to-XAML namespace mappings (NamespaceDeclaration values) that are available in the active XAML schema context.

适用于