protected override void OnDispose() { thicknessBidner?.Dispose(); if (leftValueBox == null || topValueBox == null || rightValueBox == null || bottomValueBox == null) { return; } BindingOperations.ClearAllBindings(leftValueBox); BindingOperations.ClearAllBindings(topValueBox); BindingOperations.ClearAllBindings(rightValueBox); BindingOperations.ClearAllBindings(bottomValueBox); thicknessBidner = null; leftValueBox = null; topValueBox = null; rightValueBox = null; bottomValueBox = null; }
public ThicknessSetter(DependencyObject[] targets, PropertyInfo[] pis) : base(targets, pis) { thicknessBidner = new ElementThicknessBinder(this, ValueProperty); IsMargin = pis[0].Name == "Margin"; }
public ThicknessSetter(DependencyObject target, PropertyInfo pi) : base(target, pi) { marginBinder = new ElementThicknessBinder(Target, TargetDependencyProperty); IsMargin = pi.Name == "Margin"; }