添加一个在编辑上下文中的选择更改时调用的回调方法。
命名空间:  Microsoft.Windows.Design.Interaction
程序集:  Microsoft.Windows.Design.Interaction(在 Microsoft.Windows.Design.Interaction.dll 中)
语法
声明
Public Shared Sub Subscribe ( _
    context As EditingContext, _
    handler As SubscribeContextCallback(Of Selection) _
)
public static void Subscribe(
    EditingContext context,
    SubscribeContextCallback<Selection> handler
)
public:
static void Subscribe(
    EditingContext^ context, 
    SubscribeContextCallback<Selection^>^ handler
)
static member Subscribe : 
        context:EditingContext * 
        handler:SubscribeContextCallback<Selection> -> unit 
public static function Subscribe(
    context : EditingContext, 
    handler : SubscribeContextCallback<Selection>
)
参数
- context
 类型:Microsoft.Windows.Design.EditingContext
 感兴趣的编辑上下文。
- handler
 类型:Microsoft.Windows.Design.SubscribeContextCallback<Selection>
 选择更改时调用的方法。
异常
| 异常 | 条件 | 
|---|---|
| ArgumentNullException | context 或 handler 为 nullnull 引用(在 Visual Basic 中为 Nothing)。 | 
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
请参见
参考
Microsoft.Windows.Design.Interaction 命名空间