public override void Perform() { if (IsRemoveAll) { BindingOperations.ClearAllBindings(FrameworkElement); } else { List <DependencyProperty> propertyList = PropertyForBinding.GetPropertiesForBinding(FrameworkElement); if (propertyList != null && propertyList.Count > 0) { RemoveIndex %= propertyList.Count; BindingOperations.ClearBinding(FrameworkElement, propertyList[RemoveIndex]); } } }
public override bool CanPerform() { dpList = PropertyForBinding.GetPropertiesForBinding(FrameworkElement); return(dpList != null && dpList.Count > 0); }