ContextItemManager.GetTarget 方法

[本文档仅供预览,在以后的发行版中可能会发生更改。包含的空白主题用作占位符。]

一个可返回委托的目标对象的实用工具方法。

命名空间:  Microsoft.Windows.Design
程序集:  Microsoft.Windows.Design.Extensibility(在 Microsoft.Windows.Design.Extensibility.dll 中)

语法

声明
Protected Shared Function GetTarget ( _
    callback As Delegate _
) As Object
protected static Object GetTarget(
    Delegate callback
)
protected:
static Object^ GetTarget(
    Delegate^ callback
)
static member GetTarget : 
        callback:Delegate -> Object 
protected static function GetTarget(
    callback : Delegate
) : Object

参数

返回值

类型:System.Object
回调的目标对象。

异常

异常 条件
ArgumentNullException

callback 为 nulla null reference (Nothing in Visual Basic)。

备注

如果创建该委托是为了代理一个泛型委托,则 GetTarget 方法将正确返回原始对象而非代理。

.NET Framework 安全性

请参见

参考

ContextItemManager 类

Microsoft.Windows.Design 命名空间

ContextItem

SubscribeContextCallback<TContextItemType>

ServiceManager

FeatureManager

其他资源

编辑上下文体系结构

了解 WPF 设计器扩展性