1 namespace Tizen.NUI.Binding
3 static class PaddingElement
5 public static readonly BindableProperty PaddingProperty =
6 BindableProperty.Create(nameof(IPaddingElement.Padding), typeof(Thickness), typeof(IPaddingElement), default(Thickness),
7 propertyChanged: OnPaddingPropertyChanged,
8 defaultValueCreator: PaddingDefaultValueCreator);
10 static void OnPaddingPropertyChanged(BindableObject bindable, object oldValue, object newValue)
12 ((IPaddingElement)bindable).OnPaddingPropertyChanged((Thickness)oldValue, (Thickness)newValue);
15 static object PaddingDefaultValueCreator(BindableObject bindable)
17 return ((IPaddingElement)bindable).PaddingDefaultValueCreator();
20 public static readonly BindableProperty PaddingLeftProperty =
21 BindableProperty.Create("PaddingLeft", typeof(double), typeof(IPaddingElement), default(double),
22 propertyChanged: OnPaddingLeftChanged);
24 static void OnPaddingLeftChanged(BindableObject bindable, object oldValue, object newValue)
26 var padding = (Thickness)bindable.GetValue(PaddingProperty);
27 padding.Left = (double)newValue;
28 bindable.SetValue(PaddingProperty, padding);
31 public static readonly BindableProperty PaddingTopProperty =
32 BindableProperty.Create("PaddingTop", typeof(double), typeof(IPaddingElement), default(double),
33 propertyChanged: OnPaddingTopChanged);
35 static void OnPaddingTopChanged(BindableObject bindable, object oldValue, object newValue)
37 var padding = (Thickness)bindable.GetValue(PaddingProperty);
38 padding.Top = (double)newValue;
39 bindable.SetValue(PaddingProperty, padding);
42 public static readonly BindableProperty PaddingRightProperty =
43 BindableProperty.Create("PaddingRight", typeof(double), typeof(IPaddingElement), default(double),
44 propertyChanged: OnPaddingRightChanged);
46 static void OnPaddingRightChanged(BindableObject bindable, object oldValue, object newValue)
48 var padding = (Thickness)bindable.GetValue(PaddingProperty);
49 padding.Right = (double)newValue;
50 bindable.SetValue(PaddingProperty, padding);
53 public static readonly BindableProperty PaddingBottomProperty =
54 BindableProperty.Create("PaddingBottom", typeof(double), typeof(IPaddingElement), default(double),
55 propertyChanged: OnPaddingBottomChanged);
57 static void OnPaddingBottomChanged(BindableObject bindable, object oldValue, object newValue)
59 var padding = (Thickness)bindable.GetValue(PaddingProperty);
60 padding.Bottom = (double)newValue;
61 bindable.SetValue(PaddingProperty, padding);