ContextItemManager.Subscribe 方法 (Type, SubscribeContextCallback)

当在派生类中重写时,添加一个将在指定项类型的上下文项发生更改时进行调用的回调。

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

语法

声明
Public MustOverride Sub Subscribe ( _
    contextItemType As Type, _
    callback As SubscribeContextCallback _
)
public abstract void Subscribe(
    Type contextItemType,
    SubscribeContextCallback callback
)
public:
virtual void Subscribe(
    Type^ contextItemType, 
    SubscribeContextCallback^ callback
) abstract
abstract Subscribe : 
        contextItemType:Type * 
        callback:SubscribeContextCallback -> unit 
public abstract function Subscribe(
    contextItemType : Type, 
    callback : SubscribeContextCallback
)

参数

  • contextItemType
    类型:System.Type
    要订阅的项的类型。

异常

异常 条件
ArgumentNullException

contextItemType 或 callback 为 nullnull 引用(在 Visual Basic 中为 Nothing)。

.NET Framework 安全性

请参见

参考

ContextItemManager 类

Subscribe 重载

Microsoft.Windows.Design 命名空间

ContextItem

SubscribeContextCallback<TContextItemType>

ServiceManager

FeatureManager

其他资源

编辑上下文体系结构

了解 WPF 设计器扩展性