IReceiveMarkupExtension 接口

定义

警告

此 API 现已过时。

提供一种机制,通过该机制,类型可以声明它们可从标记扩展接收表达式(或另一个类),其中的输出是一个与目标属性不同的属性类型。Provides a mechanism whereby types can declare that they can receive an expression (or another class) from a markup extension, where the output is a different property type than the target property. 请不要用于 .NET Framework 4 实现。Do not use for .NET Framework 4 implementations.

public interface class IReceiveMarkupExtension
[System.Obsolete("IReceiveMarkupExtension has been deprecated. This interface is no longer in use.")]
public interface IReceiveMarkupExtension
type IReceiveMarkupExtension = interface
Public Interface IReceiveMarkupExtension
属性

注解

.NET Framework 3.0.NET Framework 3.0IReceiveMarkupExtension , 是一种特定于 WPF 的技术, 用于允许类型在 xaml 分析期间设置为标记扩展的任何 XAML 可访问成员时输入不同的 codepath 添加等。In .NET Framework 3.0.NET Framework 3.0, IReceiveMarkupExtension was a WPF-specific technique for permitting types to enter a different codepath whenever any of its XAML-accessible members where set as markup extensions during XAML parsing. .NET Framework 4.NET Framework 4中, 此接口已过时, 并将替换为 .NET Framework XAML 服务实现, 以便标记扩展可以接收服务或类型可以调用特定于标记扩展的资源库逻辑。In .NET Framework 4.NET Framework 4, this interface is obsolete, and is replaced with a .NET Framework XAML Services implementation for how markup extensions can receive services or types can invoke markup-extension specific setter logic.

对于.NET Framework 4.NET Framework 4实现, 如果类型在通过标记扩展而不是通过其他方式设置属性时要执行特殊处理, 则应使用XamlSetMarkupExtensionAttribute应用的特性定义类型。For .NET Framework 4.NET Framework 4 implementations, if types want to perform special processing when setting properties by markup extension rather than by other means, types should be defined with XamlSetMarkupExtensionAttribute attributes applied. 特性指定一个回调, 该回调通常定义为类型的私有成员。The attribute specifies a callback, which is typically defined as a private member of the type.

在 WPF 类的基础结构实现中, 应用XamlSetMarkupExtensionAttribute的大多数情况都ReceiveMarkupExtension引用先前实现此接口的方法, 但现在改为通过回调使用上下文。In infrastructure implementations of WPF classes, most cases where XamlSetMarkupExtensionAttribute is applied reference a ReceiveMarkupExtension method that previously implemented this interface, but now instead use context through the callback.

方法

ReceiveMarkupExtension(String, MarkupExtension, IServiceProvider)

对提供属性值的标记扩展提供处理。Provides the handling for markup extensions that provide property values. 请不要用于 .NET Framework 4.NET Framework 4 实现;请参阅 IReceiveMarkupExtensionDo not use for .NET Framework 4.NET Framework 4 implementations; see IReceiveMarkupExtension.

适用于

另请参阅