共用方式為


ServiceManager.RemoveCallback 方法

從委派中移除回呼方法。

命名空間:  Microsoft.Windows.Design
組件:  Microsoft.Windows.Design.Extensibility (在 Microsoft.Windows.Design.Extensibility.dll 中)

語法

'宣告
Protected Shared Function RemoveCallback ( _
    existing As Delegate, _
    toRemove As Delegate _
) As Delegate
protected static Delegate RemoveCallback(
    Delegate existing,
    Delegate toRemove
)
protected:
static Delegate^ RemoveCallback(
    Delegate^ existing, 
    Delegate^ toRemove
)
static member RemoveCallback : 
        existing:Delegate * 
        toRemove:Delegate -> Delegate 
protected static function RemoveCallback(
    existing : Delegate, 
    toRemove : Delegate
) : Delegate

參數

  • toRemove
    型別:System.Delegate
    要從委派中移除的回呼方法。

傳回值

型別:System.Delegate
用以取代現有委派的新委派。如果 existing 為 nullNull 參照 (即 Visual Basic 中的 Nothing),則會傳回 nullNull 參照 (即 Visual Basic 中的 Nothing)。如果 toRemove 為 nullNull 參照 (即 Visual Basic 中的 Nothing),則會傳回 existing。

備註

這個方法知道如何將做為泛型回呼之 Proxy 的委派解除包裝。 如果建立這個委派的目的是要代理 (Proxy) 泛型委派,這個方法就會移除原始物件,而非該代理 (Proxy)。

您可以在 Unsubscribe 的實作中使用這個方法。

.NET Framework 安全性

請參閱

參考

ServiceManager 類別

Microsoft.Windows.Design 命名空間

EditingContext

ContextItem

其他資源

WPF 設計工具擴充性