BindingOperations.ClearBinding(DependencyObject, DependencyProperty) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
如果存在,则从属性中删除绑定。
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
要从中删除绑定的对象。
要从中删除绑定的依赖属性。
例外
target
和 dp
参数不能为 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.
如果给定属性未绑定数据,则此方法不起作用。