Пример #1
0
 private static void PaddingUnitaryPropertyChanged(ControlPropertyChangedEventArgs args)
 {
     var target = args.Target as HtmlControl;
     if (target != null && !target._settingPaddingProperty)
     {
         target._settingUnitaryPaddingProperty = true;
         var padding = target.Padding;
         if (padding == null)
         {
             padding = new Thickness();
             target.Padding = padding;
         }
         padding.Left = target.PaddingLeft;
         padding.Right = target.PaddingRight;
         padding.Top = target.PaddingTop;
         padding.Bottom = target.PaddingBottom;
         padding.Unit = target.PaddingUnit;
         target._settingUnitaryPaddingProperty = false;
     }
 }
Пример #2
0
 private static void MarginUnitaryPropertyChanged(ControlPropertyChangedEventArgs args)
 {
     var target = args.Target as HtmlControl;
     if (target != null && !target._settingMarginProperty)
     {
         target._settingUnitaryMarginProperty = true;
         var margin = target.Margin;
         if (margin == null)
         {
             margin = new Thickness();
             target.Margin = margin;
         }
         margin.Left = target.MarginLeft;
         margin.Right = target.MarginRight;
         margin.Top = target.MarginTop;
         margin.Bottom = target.MarginBottom;
         margin.Unit = target.MarginUnit;
         target._settingUnitaryMarginProperty = false;
     }
 }