BindingOperations.ClearBinding(DependencyObject, DependencyProperty) 方法

定义

如果存在,则从属性中删除绑定。

public:
 static void ClearBinding(System::Windows::DependencyObject ^ target, System::Windows::DependencyProperty ^ dp);
public static void ClearBinding (System.Windows.DependencyObject target, System.Windows.DependencyProperty dp);
static member ClearBinding : System.Windows.DependencyObject * System.Windows.DependencyProperty -> unit
Public Shared Sub ClearBinding (target As DependencyObject, dp As DependencyProperty)

参数

target
DependencyObject

要从中删除绑定的对象。

dp
DependencyProperty

要从中删除绑定的依赖属性。

例外

targetdp 参数不能为 null

注解

If the given property is data-bound with a Binding, PriorityBinding, or MultiBinding, this method removes the corresponding binding expression and restores the value of the property to what it was before any local value was set through the binding.

如果给定属性未绑定数据,则此方法不起作用。

适用于