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