开发者

Clear Binding in Silverlight (Remove Data Binding from SetBinding)

开发者 https://www.devze.com 2022-12-09 21:40 出处:网络
How do you Clear/Remove DataBinding in Silverlight? similar to: Remove binding in WPF using code But the BindingOperations.ClearBinding() me开发者_JAVA技巧thod does not exist in Silverlight 3.The Bi

How do you Clear/Remove DataBinding in Silverlight?

similar to: Remove binding in WPF using code

But the BindingOperations.ClearBinding() me开发者_JAVA技巧thod does not exist in Silverlight 3.


The BindingOperations.ClearBinding() method calls ClearValue() internally.

public static void ClearBinding(DependencyObject target, DependencyProperty dp)
{
    if (target == null)
    {
        throw new ArgumentNullException("target");
    }
    if (dp == null)
    {
        throw new ArgumentNullException("dp");
    }
    if (IsDataBound(target, dp))
    {
        target.ClearValue(dp);
    }
}

via Reflector.

0

精彩评论

暂无评论...
验证码 换一张
取 消