ActivityDelegate Class

Definition

表示基于活动的回调。Represents an activity-based callback.

public ref class ActivityDelegate abstract
[System.Windows.Markup.ContentProperty("Handler")]
public abstract class ActivityDelegate
type ActivityDelegate = class
Public MustInherit Class ActivityDelegate
Inheritance
ActivityDelegate
Derived
Attributes

Remarks

通过活动委托,活动作者可以公开具有特定签名的回调,活动的用户可为其提供基于活动的处理程序。Activity delegates enable activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. 有两种类型的活动委托:ActivityAction<T> 用于调用没有返回值的活动,而 ActivityFunc<TResult> 用于调用具有返回值的活动。There are two types of activity delegates: ActivityAction<T> is used for invoking activities that do not have a return value, and ActivityFunc<TResult> is used for invoking activities that do have a return value. 在必须对子活动进行限制,使其包含特定签名的情况下,活动委托非常有用。Activity delegates are useful in scenarios where a child activity must be constrained to having a certain signature.

Constructors

ActivityDelegate()

由派生类的构造函数调用以初始化对象。Called by derived class constructors to initialize the object.

Properties

DisplayName

获取或设置用于调试、验证、异常处理和跟踪的可选友好名称。Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking.

Handler

获取或设置由此 ActivityDelegate 表示的活动。Gets or sets the activity that is represented by this ActivityDelegate.

Methods

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetResultArgument()

在派生类中实现时,返回 DelegateOutArgumentActivityDelegateWhen implemented in a derived class, returns the DelegateOutArgument of the ActivityDelegate.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
OnGetRuntimeDelegateArguments(IList<RuntimeDelegateArgument>)

提供 ActivityDelegate 的运行时自变量列表。Supplies a list of runtime arguments for the ActivityDelegate.

ShouldSerializeDisplayName()

指示 DisplayName 属性值是否应序列化为 XAML。Indicates whether the DisplayName property value should be serialized to XAML.

ToString()

返回包含 StringActivityDelegateDisplayName 表示形式。Returns a String representation of the ActivityDelegate that contains the DisplayName.

Applies to