IReceiveMarkupExtension Interface

Definition

Warning

This API is now obsolete.

提供一种机制,通过该机制,类型可以声明它们可从标记扩展接收表达式(或另一个类),其中的输出是一个与目标属性不同的属性类型。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
public interface IReceiveMarkupExtension
type IReceiveMarkupExtension = interface
Public Interface IReceiveMarkupExtension
Attributes

Remarks

.NET Framework 3.0.NET Framework 3.0中,IReceiveMarkupExtension 是特定于 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.

Methods

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.

Applies to

See also