ActivityDelegate 類別

定義

表示活動的回呼。Represents an activity-based callback.

public ref class ActivityDelegate abstract
[System.Windows.Markup.ContentProperty("Handler")]
public abstract class ActivityDelegate
[<System.Windows.Markup.ContentProperty("Handler")>]
type ActivityDelegate = class
Public MustInherit Class ActivityDelegate
繼承
ActivityDelegate
衍生
屬性

備註

活動委派可讓活動作者使用特定的簽章以公開回呼,活動使用者可據此提供活動處理常式。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.

建構函式

ActivityDelegate()

由衍生類別的建構函式呼叫,以初始化物件。Called by derived class constructors to initialize the object.

屬性

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.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetResultArgument()

在衍生類別中實作時,會傳回 DelegateOutArgumentActivityDelegateWhen implemented in a derived class, returns the DelegateOutArgument of the ActivityDelegate.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 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()

傳回 StringActivityDelegate 表示,其中包含 DisplayNameReturns a String representation of the ActivityDelegate that contains the DisplayName.

適用於