Example #1
0
 internal void NotifyPropertyChanged(HtmlObject htmlObject, object oldValue, object newValue)
 {
     if (this.PropertyChangedCallback != null)
     {
         var args = new ControlPropertyChangedEventArgs(htmlObject, this, oldValue, newValue);
         this.PropertyChangedCallback.Invoke(args);
     }
 }
Example #2
0
 private static void CustomMaskPropertyChanged(ControlPropertyChangedEventArgs args)
 {
     if (args.NewValue.AsString().HasValue())
     {
         args.Target.SetValue(MaskProperty, InputMask.Custom);
     }
     else if (((InputMask)args.Target.GetValue(MaskProperty)) == InputMask.Custom)
     {
         args.Target.SetValue(MaskProperty, InputMask.Default);
     }
 }
Example #3
0
        private static void MarginPropertyChanged(ControlPropertyChangedEventArgs args)
        {
            var target = args.Target as HtmlControl;

            if (target != null && !target._settingUnitaryMarginProperty)
            {
                target._settingMarginProperty = true;
                var margin = args.NewValue as Thickness;
                target.MarginLeft   = margin.Left;
                target.MarginRight  = margin.Right;
                target.MarginTop    = margin.Top;
                target.MarginBottom = margin.Bottom;
                target.MarginUnit   = margin.Unit;
                target._settingUnitaryMarginProperty = false;
            }
        }
Example #4
0
        private static void PaddingPropertyChanged(ControlPropertyChangedEventArgs args)
        {
            var target = args.Target as HtmlControl;

            if (target != null && !target._settingUnitaryPaddingProperty)
            {
                target._settingPaddingProperty = true;
                var padding = args.NewValue as Thickness;
                target.PaddingLeft   = padding.Left;
                target.PaddingRight  = padding.Right;
                target.PaddingTop    = padding.Top;
                target.PaddingBottom = padding.Bottom;
                target.PaddingUnit   = padding.Unit;
                target._settingUnitaryPaddingProperty = false;
            }
        }
Example #5
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;
            }
        }
Example #6
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;
            }
        }
Example #7
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;
     }
 }
Example #8
0
 private static void PaddingPropertyChanged(ControlPropertyChangedEventArgs args)
 {
     var target = args.Target as HtmlControl;
     if (target != null && !target._settingUnitaryPaddingProperty)
     {
         target._settingPaddingProperty = true;
         var padding = args.NewValue as Thickness;
         target.PaddingLeft = padding.Left;
         target.PaddingRight = padding.Right;
         target.PaddingTop = padding.Top;
         target.PaddingBottom = padding.Bottom;
         target.PaddingUnit = padding.Unit;
         target._settingUnitaryPaddingProperty = false;
     }
 }
Example #9
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;
     }
 }
Example #10
0
 private static void MarginPropertyChanged(ControlPropertyChangedEventArgs args)
 {
     var target = args.Target as HtmlControl;
     if (target != null && !target._settingUnitaryMarginProperty)
     {
         target._settingMarginProperty = true;
         var margin = args.NewValue as Thickness;
         target.MarginLeft = margin.Left;
         target.MarginRight = margin.Right;
         target.MarginTop = margin.Top;
         target.MarginBottom = margin.Bottom;
         target.MarginUnit = margin.Unit;
         target._settingUnitaryMarginProperty = false;
     }
 }
Example #11
0
 private static void CustomMaskPropertyChanged(ControlPropertyChangedEventArgs args)
 {
     if (args.NewValue.AsString().HasValue())
         args.Target.SetValue(MaskProperty, InputMask.Custom);
     else if (((InputMask)args.Target.GetValue(MaskProperty)) == InputMask.Custom)
         args.Target.SetValue(MaskProperty, InputMask.Default);
 }
Example #12
0
 internal void NotifyPropertyChanged(HtmlObject htmlObject, object oldValue, object newValue)
 {
     if (this.PropertyChangedCallback != null)
     {
         var args = new ControlPropertyChangedEventArgs(htmlObject, this, oldValue, newValue);
         this.PropertyChangedCallback.Invoke(args);
     }
 }