[NUI] Remove bindings between Style and View (#1788)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / Style / ViewStyle.cs
1 /*
2  * Copyright(c) 2020 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using Tizen.NUI.Binding;
21
22 namespace Tizen.NUI.BaseComponents
23 {
24     /// <summary>
25     /// The base class for Children attributes in Components.
26     /// </summary>
27     /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
28     [EditorBrowsable(EditorBrowsableState.Never)]
29     public partial class ViewStyle : BindableObject
30     {
31         private string styleName;
32         private View.States? state;
33         private View.States? subState;
34         private float? flex;
35         private int? alignSelf;
36         private Vector4 flexMargin;
37         private Vector2 cellIndex;
38         private float? rowSpan;
39         private float? columnSpan;
40         private HorizontalAlignmentType? cellHorizontalAlignment;
41         private VerticalAlignmentType? cellVerticalAlignment;
42         private View leftFocusableView;
43         private View rightFocusableView;
44         private View upFocusableView;
45         private View downFocusableView;
46         private bool? focusable;
47         private bool? positionUsesPivotPoint;
48         private int? siblingOrder;
49         private Position parentOrigin;
50         private Position pivotPoint;
51         private Position position;
52         private Rotation orientation;
53         private Vector3 scale;
54         private string name;
55         private bool? sensitive;
56         private bool? leaveRequired;
57         private bool? inheritOrientation;
58         private bool? inheritScale;
59         private DrawModeType? drawMode;
60         private Vector3 sizeModeFactor;
61         private ResizePolicyType? widthResizePolicy;
62         private ResizePolicyType? heightResizePolicy;
63         private SizeScalePolicyType? sizeScalePolicy;
64         private bool? widthForHeight;
65         private bool? heightForWidth;
66         private Extents padding;
67         private Size2D minimumSize;
68         private Size2D maximumSize;
69         private bool? inheritPosition;
70         private ClippingModeType? clippingMode;
71         private Size size;
72         private bool? inheritLayoutDirection;
73         private ViewLayoutDirectionType? layoutDirection;
74         private Extents margin;
75         private float? weight;
76
77         private Selector<ImageShadow> imageShadow;
78         private Selector<Shadow> boxShadow;
79         private Selector<string> backgroundImageSelector;
80         private Selector<float?> cornerRadius;
81         private Selector<float?> opacitySelector;
82         private Selector<Color> backgroundColorSelector;
83         private Selector<Rectangle> backgroundImageBorderSelector;
84         private Selector<Color> colorSelector;
85
86         static ViewStyle() {}
87
88         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
89         [EditorBrowsable(EditorBrowsableState.Never)]
90         public ViewStyle() { }
91
92         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
93         [EditorBrowsable(EditorBrowsableState.Never)]
94         public ViewStyle(ViewStyle viewAttributes)
95         {
96             if (null != viewAttributes)
97             {
98                 this.CopyFrom(viewAttributes);
99             }
100         }
101
102         /// <summary>
103         /// Create an instance and set properties from the given view.
104         /// </summary>
105         /// <param name="view">The View that includes property data.</param>
106         [EditorBrowsable(EditorBrowsableState.Never)]
107         public ViewStyle(View view)
108         {
109             CopyPropertiesFromView(view);
110         }
111
112         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
113         [EditorBrowsable(EditorBrowsableState.Never)]
114         public string StyleName
115         {
116             get => (string)GetValue(StyleNameProperty);
117             set => SetValue(StyleNameProperty, value);
118         }
119
120         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
121         [EditorBrowsable(EditorBrowsableState.Never)]
122         public Selector<string> BackgroundImage
123         {
124             get
125             {
126                 Selector<string> image = (Selector<string>)GetValue(BackgroundImageSelectorProperty);
127                 return (null != image) ? image : backgroundImageSelector = new Selector<string>();
128             }
129             set => SetValue(BackgroundImageSelectorProperty, value);
130         }
131
132         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
133         [EditorBrowsable(EditorBrowsableState.Never)]
134         public View.States? State
135         {
136             get => (View.States?)GetValue(StateProperty);
137             set => SetValue(StateProperty, value);
138         }
139
140         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
141         [EditorBrowsable(EditorBrowsableState.Never)]
142         public View.States? SubState
143         {
144             get => (View.States?)GetValue(SubStateProperty);
145             set => SetValue(SubStateProperty, value);
146         }
147
148         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
149         [EditorBrowsable(EditorBrowsableState.Never)]
150         public float? Flex
151         {
152             get => (float?)GetValue(FlexProperty);
153             set => SetValue(FlexProperty, value);
154         }
155
156         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
157         [EditorBrowsable(EditorBrowsableState.Never)]
158         public int? AlignSelf
159         {
160             get => (int?)GetValue(AlignSelfProperty);
161             set => SetValue(AlignSelfProperty, value);
162         }
163
164         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
165         [EditorBrowsable(EditorBrowsableState.Never)]
166         public Vector4 FlexMargin
167         {
168             get => (Vector4)GetValue(FlexMarginProperty);
169             set => SetValue(FlexMarginProperty, value);
170         }
171
172         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
173         [EditorBrowsable(EditorBrowsableState.Never)]
174         public Vector2 CellIndex
175         {
176             get => (Vector2)GetValue(CellIndexProperty);
177             set => SetValue(CellIndexProperty, value);
178         }
179
180         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
181         [EditorBrowsable(EditorBrowsableState.Never)]
182         public float? RowSpan
183         {
184             get => (float?)GetValue(RowSpanProperty);
185             set => SetValue(RowSpanProperty, value);
186         }
187
188         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
189         [EditorBrowsable(EditorBrowsableState.Never)]
190         public float? ColumnSpan
191         {
192             get => (float?)GetValue(ColumnSpanProperty);
193             set => SetValue(ColumnSpanProperty, value);
194         }
195
196         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
197         [EditorBrowsable(EditorBrowsableState.Never)]
198         public HorizontalAlignmentType? CellHorizontalAlignment
199         {
200             get => (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty);
201             set => SetValue(CellHorizontalAlignmentProperty, value);
202         }
203
204         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
205         [EditorBrowsable(EditorBrowsableState.Never)]
206         public VerticalAlignmentType? CellVerticalAlignment
207         {
208             get => (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty);
209             set => SetValue(CellVerticalAlignmentProperty, value);
210         }
211
212         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
213         [EditorBrowsable(EditorBrowsableState.Never)]
214         public View LeftFocusableView
215         {
216             get => (View)GetValue(LeftFocusableViewProperty);
217             set => SetValue(LeftFocusableViewProperty, value);
218         }
219
220         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
221         [EditorBrowsable(EditorBrowsableState.Never)]
222         public View RightFocusableView
223         {
224             get => (View)GetValue(RightFocusableViewProperty);
225             set => SetValue(RightFocusableViewProperty, value);
226         }
227
228         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
229         [EditorBrowsable(EditorBrowsableState.Never)]
230         public View UpFocusableView
231         {
232             get => (View)GetValue(UpFocusableViewProperty);
233             set => SetValue(UpFocusableViewProperty, value);
234         }
235
236         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
237         [EditorBrowsable(EditorBrowsableState.Never)]
238         public View DownFocusableView
239         {
240             get => (View)GetValue(DownFocusableViewProperty);
241             set => SetValue(DownFocusableViewProperty, value);
242         }
243
244         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
245         [EditorBrowsable(EditorBrowsableState.Never)]
246         public bool? Focusable
247         {
248             get => (bool?)GetValue(FocusableProperty);
249             set => SetValue(FocusableProperty, value);
250         }
251
252         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
253         [EditorBrowsable(EditorBrowsableState.Never)]
254         public Size2D Size2D
255         {
256             get => (Size2D)GetValue(Size2DProperty);
257             set => SetValue(Size2DProperty, value);
258         }
259
260         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
261         [EditorBrowsable(EditorBrowsableState.Never)]
262         public Selector<float?> Opacity
263         {
264             get
265             {
266                 Selector<float?> opacity = (Selector<float?>)GetValue(OpacitySelectorProperty);
267                 return (null != opacity) ? opacity : opacitySelector = new Selector<float?>();
268             }
269             set => SetValue(OpacitySelectorProperty, value);
270         }
271
272         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
273         [EditorBrowsable(EditorBrowsableState.Never)]
274         public Position2D Position2D
275         {
276             get => (Position2D)GetValue(Position2DProperty);
277             set => SetValue(Position2DProperty, value);
278         }
279
280         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
281         [EditorBrowsable(EditorBrowsableState.Never)]
282         public bool? PositionUsesPivotPoint
283         {
284             get => (bool?)GetValue(PositionUsesPivotPointProperty);
285             set => SetValue(PositionUsesPivotPointProperty, value);
286         }
287
288         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
289         [EditorBrowsable(EditorBrowsableState.Never)]
290         public int? SiblingOrder
291         {
292             get => (int?)GetValue(SiblingOrderProperty);
293             set => SetValue(SiblingOrderProperty, value);
294         }
295
296         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
297         [EditorBrowsable(EditorBrowsableState.Never)]
298         public Position ParentOrigin
299         {
300             get => (Position)GetValue(ParentOriginProperty);
301             set => SetValue(ParentOriginProperty, value);
302         }
303
304         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
305         [EditorBrowsable(EditorBrowsableState.Never)]
306         public Position PivotPoint
307         {
308             get => (Position)GetValue(PivotPointProperty);
309             set => SetValue(PivotPointProperty, value);
310         }
311
312         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
313         [EditorBrowsable(EditorBrowsableState.Never)]
314         public float? SizeWidth
315         {
316             get => (float?)GetValue(SizeWidthProperty);
317             set => SetValue(SizeWidthProperty, value);
318         }
319
320         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
321         [EditorBrowsable(EditorBrowsableState.Never)]
322         public float? SizeHeight
323         {
324             get => (float?)GetValue(SizeHeightProperty);
325             set => SetValue(SizeHeightProperty, value);
326         }
327
328         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
329         [EditorBrowsable(EditorBrowsableState.Never)]
330         public Position Position
331         {
332             get => (Position)GetValue(PositionProperty);
333             set => SetValue(PositionProperty, value);
334         }
335
336         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
337         [EditorBrowsable(EditorBrowsableState.Never)]
338         public float? PositionX
339         {
340             get => (float?)GetValue(PositionXProperty);
341             set => SetValue(PositionXProperty, value);
342         }
343
344         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
345         [EditorBrowsable(EditorBrowsableState.Never)]
346         public float? PositionY
347         {
348             get => (float?)GetValue(PositionYProperty);
349             set => SetValue(PositionYProperty, value);
350         }
351
352         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
353         [EditorBrowsable(EditorBrowsableState.Never)]
354         public float? PositionZ
355         {
356             get => (float?)GetValue(PositionZProperty);
357             set => SetValue(PositionZProperty, value);
358         }
359
360         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
361         [EditorBrowsable(EditorBrowsableState.Never)]
362         public Rotation Orientation
363         {
364             get => (Rotation)GetValue(OrientationProperty);
365             set => SetValue(OrientationProperty, value);
366         }
367
368         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
369         [EditorBrowsable(EditorBrowsableState.Never)]
370         public Vector3 Scale
371         {
372             get => (Vector3)GetValue(ScaleProperty);
373             set => SetValue(ScaleProperty, value);
374         }
375
376         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
377         [EditorBrowsable(EditorBrowsableState.Never)]
378         public float? ScaleX
379         {
380             get => (float?)GetValue(ScaleXProperty);
381             set => SetValue(ScaleXProperty, value);
382         }
383
384         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
385         [EditorBrowsable(EditorBrowsableState.Never)]
386         public float? ScaleY
387         {
388             get => (float?)GetValue(ScaleYProperty);
389             set => SetValue(ScaleYProperty, value);
390         }
391
392         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
393         [EditorBrowsable(EditorBrowsableState.Never)]
394         public float? ScaleZ
395         {
396             get => (float?)GetValue(ScaleZProperty);
397             set => SetValue(ScaleZProperty, value);
398         }
399
400         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
401         [EditorBrowsable(EditorBrowsableState.Never)]
402         public string Name
403         {
404             get => (string)GetValue(NameProperty);
405             set => SetValue(NameProperty, value);
406         }
407
408         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
409         [EditorBrowsable(EditorBrowsableState.Never)]
410         public bool? Sensitive
411         {
412             get => (bool?)GetValue(SensitiveProperty);
413             set => SetValue(SensitiveProperty, value);
414         }
415
416         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
417         [EditorBrowsable(EditorBrowsableState.Never)]
418         public bool? LeaveRequired
419         {
420             get => (bool?)GetValue(LeaveRequiredProperty);
421             set => SetValue(LeaveRequiredProperty, value);
422         }
423
424         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
425         [EditorBrowsable(EditorBrowsableState.Never)]
426         public bool? InheritOrientation
427         {
428             get => (bool?)GetValue(InheritOrientationProperty);
429             set => SetValue(InheritOrientationProperty, value);
430         }
431
432         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
433         [EditorBrowsable(EditorBrowsableState.Never)]
434         public bool? InheritScale
435         {
436             get => (bool?)GetValue(InheritScaleProperty);
437             set => SetValue(InheritScaleProperty, value);
438         }
439
440         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
441         [EditorBrowsable(EditorBrowsableState.Never)]
442         public DrawModeType? DrawMode
443         {
444             get => (DrawModeType?)GetValue(DrawModeProperty);
445             set => SetValue(DrawModeProperty, value);
446         }
447
448         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
449         [EditorBrowsable(EditorBrowsableState.Never)]
450         public Vector3 SizeModeFactor
451         {
452             get => (Vector3)GetValue(SizeModeFactorProperty);
453             set => SetValue(SizeModeFactorProperty, value);
454         }
455
456         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
457         [EditorBrowsable(EditorBrowsableState.Never)]
458         public ResizePolicyType? WidthResizePolicy
459         {
460             get => (ResizePolicyType?)GetValue(WidthResizePolicyProperty);
461             set => SetValue(WidthResizePolicyProperty, value);
462         }
463
464         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
465         [EditorBrowsable(EditorBrowsableState.Never)]
466         public ResizePolicyType? HeightResizePolicy
467         {
468             get => (ResizePolicyType?)GetValue(HeightResizePolicyProperty);
469             set => SetValue(HeightResizePolicyProperty, value);
470         }
471
472         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
473         [EditorBrowsable(EditorBrowsableState.Never)]
474         public SizeScalePolicyType? SizeScalePolicy
475         {
476             get => (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty);
477             set => SetValue(SizeScalePolicyProperty, value);
478         }
479
480         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
481         [EditorBrowsable(EditorBrowsableState.Never)]
482         public bool? WidthForHeight
483         {
484             get => (bool?)GetValue(WidthForHeightProperty);
485             set => SetValue(WidthForHeightProperty, value);
486         }
487
488         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
489         [EditorBrowsable(EditorBrowsableState.Never)]
490         public bool? HeightForWidth
491         {
492             get => (bool?)GetValue(HeightForWidthProperty);
493             set => SetValue(HeightForWidthProperty, value);
494         }
495
496         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
497         [EditorBrowsable(EditorBrowsableState.Never)]
498         public Extents Padding
499         {
500             get
501             {
502                 Extents tmp = (Extents)GetValue(PaddingProperty);
503                 return (null != tmp) ? tmp : padding = new Extents(OnPaddingChanged, 0, 0, 0, 0);
504             }
505             set => SetValue(PaddingProperty, value);
506         }
507
508         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
509         [EditorBrowsable(EditorBrowsableState.Never)]
510         public Size2D MinimumSize
511         {
512             get => (Size2D)GetValue(MinimumSizeProperty);
513             set => SetValue(MinimumSizeProperty, value);
514         }
515
516         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
517         [EditorBrowsable(EditorBrowsableState.Never)]
518         public Size2D MaximumSize
519         {
520             get => (Size2D)GetValue(MaximumSizeProperty);
521             set => SetValue(MaximumSizeProperty, value);
522         }
523
524         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
525         [EditorBrowsable(EditorBrowsableState.Never)]
526         public bool? InheritPosition
527         {
528             get => (bool?)GetValue(InheritPositionProperty);
529             set => SetValue(InheritPositionProperty, value);
530         }
531
532         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
533         [EditorBrowsable(EditorBrowsableState.Never)]
534         public ClippingModeType? ClippingMode
535         {
536             get => (ClippingModeType?)GetValue(ClippingModeProperty);
537             set => SetValue(ClippingModeProperty, value);
538         }
539
540         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
541         [EditorBrowsable(EditorBrowsableState.Never)]
542         public Size Size
543         {
544             get
545             {
546                 Size tmp = (Size)GetValue(SizeProperty);
547                 return (null != tmp) ? tmp : size = new Size((float width, float height, float depth) => { Size = new Size(width, height, depth); }, 0, 0, 0);
548             }
549             set => SetValue(SizeProperty, value);
550         }
551
552         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
553         [EditorBrowsable(EditorBrowsableState.Never)]
554         public bool? InheritLayoutDirection
555         {
556             get => (bool?)GetValue(InheritLayoutDirectionProperty);
557             set => SetValue(InheritLayoutDirectionProperty, value);
558         }
559
560         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
561         [EditorBrowsable(EditorBrowsableState.Never)]
562         public ViewLayoutDirectionType? LayoutDirection
563         {
564             get => (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty);
565             set => SetValue(LayoutDirectionProperty, value);
566         }
567
568         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
569         [EditorBrowsable(EditorBrowsableState.Never)]
570         public Extents Margin
571         {
572             get
573             {
574                 Extents tmp = (Extents)GetValue(MarginProperty);
575                 return (null != tmp) ? tmp : margin = new Extents(OnMarginChanged, 0, 0, 0, 0);
576             }
577             set => SetValue(MarginProperty, value);
578         }
579
580         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
581         [EditorBrowsable(EditorBrowsableState.Never)]
582         public float? Weight
583         {
584             get => (float?)GetValue(WeightProperty);
585             set => SetValue(WeightProperty, value);
586         }
587
588         /// <summary> View BackgroundColor </summary>
589         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
590         [EditorBrowsable(EditorBrowsableState.Never)]
591         public Selector<Color> BackgroundColor
592         {
593             get
594             {
595                 Selector<Color> color = (Selector<Color>)GetValue(BackgroundColorSelectorProperty);
596                 return (null != color) ? color : backgroundColorSelector = new Selector<Color>();
597             }
598             set => SetValue(BackgroundColorSelectorProperty, value);
599         }
600
601         /// <summary>
602         /// Color
603         /// </summary>
604         [EditorBrowsable(EditorBrowsableState.Never)]
605         public Selector<Color> Color
606         {
607             get
608             {
609                 Selector<Color> color = (Selector<Color>)GetValue(ColorSelectorProperty);
610                 return (null != color) ? color : colorSelector = new Selector<Color>();
611             }
612             set => SetValue(ColorSelectorProperty, value);
613         }
614
615         /// <summary>View BackgroundBorder</summary>
616         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
617         [EditorBrowsable(EditorBrowsableState.Never)]
618         public Selector<Rectangle> BackgroundImageBorder
619         {
620             get
621             {
622                 Selector<Rectangle> border = (Selector<Rectangle>)GetValue(BackgroundImageBorderSelectorProperty);
623                 return (null != border) ? border : backgroundImageBorderSelector = new Selector<Rectangle>();
624             }
625             set => SetValue(BackgroundImageBorderSelectorProperty, value);
626         }
627
628         /// <summary>
629         /// Describes a shadow as an image for a View.
630         /// It is null by default.
631         /// </summary>
632         /// <remarks>
633         /// If BoxShadow is not null, the ImageShadow value will be ignored.
634         /// </remarks>
635         [EditorBrowsable(EditorBrowsableState.Never)]
636         public Selector<ImageShadow> ImageShadow
637         {
638             get => (Selector<ImageShadow>)GetValue(ImageShadowSelectorProperty);
639             set => SetValue(ImageShadowSelectorProperty, value);
640         }
641
642         /// <summary>
643         /// Describes a box shaped shadow drawing for a View.
644         /// It is null by default.
645         /// </summary>
646         [EditorBrowsable(EditorBrowsableState.Never)]
647         public Selector<Shadow> BoxShadow
648         {
649             get => (Selector<Shadow>)GetValue(BoxShadowSelectorProperty);
650             set => SetValue(BoxShadowSelectorProperty, value);
651         }
652
653         /// <summary>
654         /// The radius for the rounded corners of the View
655         /// </summary>
656         [EditorBrowsable(EditorBrowsableState.Never)]
657         public Selector<float?> CornerRadius
658         {
659             get => (Selector<float?>)GetValue(CornerRadiusProperty);
660             set => SetValue(CornerRadiusProperty, value);
661         }
662
663         /// <summary>
664         /// Set style's bindable properties from the view.
665         /// </summary>
666         /// <param name="view">The view that includes property data.</param>
667         [EditorBrowsable(EditorBrowsableState.Never)]
668         public virtual void CopyPropertiesFromView(View view)
669         {
670             if (view == null) return;
671
672             BindableProperty.GetBindablePropertysOfType(GetType(), out var styleProperties);            
673             BindableProperty.GetBindablePropertysOfType(view.GetType(), out var viewProperties);
674             
675
676             if (styleProperties == null || viewProperties == null) return;
677
678             foreach (var stylePropertyItem in styleProperties)
679             {
680                 viewProperties.TryGetValue(stylePropertyItem.Key, out var viewProperty);
681
682                 if (viewProperty == null) continue;
683
684                 SetValue(stylePropertyItem.Value, view.GetValue(viewProperty));
685             }
686         }
687
688         internal ViewStyle CreateInstance()
689         {
690             return (ViewStyle)Activator.CreateInstance(GetType());
691         }
692
693         internal ViewStyle Clone()
694         {
695             var cloned = CreateInstance();
696             cloned.CopyFrom(this);
697
698             return cloned;
699         }
700
701         private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
702         {
703             Padding = new Extents(start, end, top, bottom);
704         }
705
706         private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom)
707         {
708             Margin = new Extents(start, end, top, bottom);
709         }
710     }
711 }