Пример #1
0
        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;
        }
Пример #2
0
 public ThicknessSetter(DependencyObject[] targets, PropertyInfo[] pis) : base(targets, pis)
 {
     thicknessBidner = new ElementThicknessBinder(this, ValueProperty);
     IsMargin        = pis[0].Name == "Margin";
 }
Пример #3
0
 public ThicknessSetter(DependencyObject target, PropertyInfo pi) : base(target, pi)
 {
     marginBinder = new ElementThicknessBinder(Target, TargetDependencyProperty);
     IsMargin     = pi.Name == "Margin";
 }