[NUI] Enable selectors work in View : EnableControlState (#1851)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / Style / ViewStyleBindableProperty.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.ComponentModel;
18 using Tizen.NUI.Binding;
19
20 namespace Tizen.NUI.BaseComponents
21 {
22     public partial class ViewStyle
23     {
24         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
25         [EditorBrowsable(EditorBrowsableState.Never)]
26         public static readonly BindableProperty StyleNameProperty = BindableProperty.Create(nameof(StyleName), typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
27         {
28             var viewStyle = (ViewStyle)bindable;
29             viewStyle.styleName = (string)newValue;
30         },
31         defaultValueCreator: (bindable) =>
32         {
33             var viewStyle = (ViewStyle)bindable;
34             return viewStyle.styleName;
35         });
36         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
37         [EditorBrowsable(EditorBrowsableState.Never)]
38         public static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
39         {
40             var viewStyle = (ViewStyle)bindable;
41
42             if (newValue == null)
43             {
44                 viewStyle.backgroundImageSelector = null;
45             }
46             else
47             {
48                 viewStyle.backgroundImageSelector = ((Selector<string>)newValue).Clone();
49                 viewStyle.backgroundColorSelector = null;
50             }
51         },
52         defaultValueCreator: (bindable) =>
53         {
54             var viewStyle = (ViewStyle)bindable;
55             return viewStyle.backgroundImageSelector;
56         });
57         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
58         [EditorBrowsable(EditorBrowsableState.Never)]
59         public static readonly BindableProperty StateProperty = BindableProperty.Create(nameof(State), typeof(View.States?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
60         {
61             var viewStyle = (ViewStyle)bindable;
62             viewStyle.state = (View.States?)newValue;
63         },
64         defaultValueCreator: (bindable) =>
65         {
66             var viewStyle = (ViewStyle)bindable;
67             return viewStyle.state;
68         });
69         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
70         [EditorBrowsable(EditorBrowsableState.Never)]
71         public static readonly BindableProperty SubStateProperty = BindableProperty.Create(nameof(SubState), typeof(View.States?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
72         {
73             var viewStyle = (ViewStyle)bindable;
74             viewStyle.subState = (View.States?)newValue;
75         },
76         defaultValueCreator: (bindable) =>
77         {
78             var viewStyle = (ViewStyle)bindable;
79             return viewStyle.subState;
80         });
81         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
82         [EditorBrowsable(EditorBrowsableState.Never)]
83         public static readonly BindableProperty FlexProperty = BindableProperty.Create(nameof(Flex), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
84         {
85             var viewStyle = (ViewStyle)bindable;
86             viewStyle.flex = (float?)newValue;
87         },
88         defaultValueCreator: (bindable) =>
89         {
90             var viewStyle = (ViewStyle)bindable;
91             return viewStyle.flex;
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 static readonly BindableProperty AlignSelfProperty = BindableProperty.Create(nameof(AlignSelf), typeof(int?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
96         {
97             var viewStyle = (ViewStyle)bindable;
98             viewStyle.alignSelf = (int?)newValue;
99         },
100         defaultValueCreator: (bindable) =>
101         {
102             var viewStyle = (ViewStyle)bindable;
103             return viewStyle.alignSelf;
104         });
105         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
106         [EditorBrowsable(EditorBrowsableState.Never)]
107         public static readonly BindableProperty FlexMarginProperty = BindableProperty.Create(nameof(FlexMargin), typeof(Vector4), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
108         {
109             var viewStyle = (ViewStyle)bindable;
110             viewStyle.flexMargin = (Vector4)newValue;
111         },
112         defaultValueCreator: (bindable) =>
113         {
114             var viewStyle = (ViewStyle)bindable;
115             return viewStyle.flexMargin;
116         });
117         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
118         [EditorBrowsable(EditorBrowsableState.Never)]
119         public static readonly BindableProperty CellIndexProperty = BindableProperty.Create(nameof(CellIndex), typeof(Vector2), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
120         {
121             var viewStyle = (ViewStyle)bindable;
122             viewStyle.cellIndex = (Vector2)newValue;
123         },
124         defaultValueCreator: (bindable) =>
125         {
126             var viewStyle = (ViewStyle)bindable;
127             return viewStyle.cellIndex;
128         });
129         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
130         [EditorBrowsable(EditorBrowsableState.Never)]
131         public static readonly BindableProperty RowSpanProperty = BindableProperty.Create(nameof(RowSpan), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
132         {
133             var viewStyle = (ViewStyle)bindable;
134             viewStyle.rowSpan = (float?)newValue;
135         },
136         defaultValueCreator: (bindable) =>
137         {
138             var viewStyle = (ViewStyle)bindable;
139             return viewStyle.rowSpan;
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 static readonly BindableProperty ColumnSpanProperty = BindableProperty.Create(nameof(ColumnSpan), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
144         {
145             var viewStyle = (ViewStyle)bindable;
146             viewStyle.columnSpan = (float?)newValue;
147         },
148         defaultValueCreator: (bindable) =>
149         {
150             var viewStyle = (ViewStyle)bindable;
151             return viewStyle.columnSpan;
152         });
153         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
154         [EditorBrowsable(EditorBrowsableState.Never)]
155         public static readonly BindableProperty CellHorizontalAlignmentProperty = BindableProperty.Create(nameof(CellHorizontalAlignment), typeof(HorizontalAlignmentType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
156         {
157             var viewStyle = (ViewStyle)bindable;
158             viewStyle.cellHorizontalAlignment = (HorizontalAlignmentType?)newValue;
159         },
160         defaultValueCreator: (bindable) =>
161         {
162             var viewStyle = (ViewStyle)bindable;
163             return viewStyle.cellHorizontalAlignment;
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 static readonly BindableProperty CellVerticalAlignmentProperty = BindableProperty.Create(nameof(CellVerticalAlignment), typeof(VerticalAlignmentType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
168         {
169             var viewStyle = (ViewStyle)bindable;
170             viewStyle.cellVerticalAlignment = (VerticalAlignmentType?)newValue;
171         },
172         defaultValueCreator: (bindable) =>
173         {
174             var viewStyle = (ViewStyle)bindable;
175             return viewStyle.cellVerticalAlignment;
176         });
177         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
178         [EditorBrowsable(EditorBrowsableState.Never)]
179         public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create(nameof(LeftFocusableView), typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
180         {
181             var viewStyle = (ViewStyle)bindable;
182             viewStyle.leftFocusableView = (View)newValue;
183         },
184         defaultValueCreator: (bindable) =>
185         {
186             var viewStyle = (ViewStyle)bindable;
187             return viewStyle.leftFocusableView;
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 static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create(nameof(RightFocusableView), typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
192         {
193             var viewStyle = (ViewStyle)bindable;
194             viewStyle.rightFocusableView = (View)newValue;
195         },
196         defaultValueCreator: (bindable) =>
197         {
198             var viewStyle = (ViewStyle)bindable;
199             return viewStyle.rightFocusableView;
200         });
201         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
202         [EditorBrowsable(EditorBrowsableState.Never)]
203         public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create(nameof(UpFocusableView), typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
204         {
205             var viewStyle = (ViewStyle)bindable;
206             viewStyle.upFocusableView = (View)newValue;
207         },
208         defaultValueCreator: (bindable) =>
209         {
210             var viewStyle = (ViewStyle)bindable;
211             return viewStyle.upFocusableView;
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 static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create(nameof(DownFocusableView), typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
216         {
217             var viewStyle = (ViewStyle)bindable;
218             viewStyle.downFocusableView = (View)newValue;
219         },
220         defaultValueCreator: (bindable) =>
221         {
222             var viewStyle = (ViewStyle)bindable;
223             return viewStyle.downFocusableView;
224         });
225         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
226         [EditorBrowsable(EditorBrowsableState.Never)]
227         public static readonly BindableProperty FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
228         {
229             var viewStyle = (ViewStyle)bindable;
230             viewStyle.focusable = (bool?)newValue;
231         },
232         defaultValueCreator: (bindable) =>
233         {
234             var viewStyle = (ViewStyle)bindable;
235             return viewStyle.focusable;
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 static readonly BindableProperty Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
240         {
241             var viewStyle = (ViewStyle)bindable;
242             viewStyle.size = newValue == null ? null : new Size((Size2D)newValue);
243         },
244         defaultValueCreator: (bindable) =>
245         {
246             var viewStyle = (ViewStyle)bindable;
247             return viewStyle.size == null ? null : (Size2D)viewStyle.size;
248         });
249         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
250         [EditorBrowsable(EditorBrowsableState.Never)]
251         public static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
252         {
253             ((ViewStyle)bindable).opacitySelector = ((Selector<float?>)newValue)?.Clone();
254         },
255         defaultValueCreator: (bindable) =>
256         {
257             var controlStyle = (ViewStyle)bindable;
258             return controlStyle.opacitySelector;
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 static readonly BindableProperty Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
263         {
264             var viewStyle = (ViewStyle)bindable;
265             viewStyle.position = newValue == null ? null : new Position((Position2D)newValue);
266         },
267         defaultValueCreator: (bindable) =>
268         {
269             var viewStyle = (ViewStyle)bindable;
270             return viewStyle.position == null ? null : new Position2D(viewStyle.position);
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 static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
275         {
276             var viewStyle = (ViewStyle)bindable;
277             viewStyle.positionUsesPivotPoint = (bool?)newValue;
278         },
279         defaultValueCreator: (bindable) =>
280         {
281             var viewStyle = (ViewStyle)bindable;
282             return viewStyle.positionUsesPivotPoint;
283         });
284         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
285         [EditorBrowsable(EditorBrowsableState.Never)]
286         public static readonly BindableProperty SiblingOrderProperty = BindableProperty.Create(nameof(SiblingOrder), typeof(int?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
287         {
288             var viewStyle = (ViewStyle)bindable;
289             viewStyle.siblingOrder = (int?)newValue;
290         },
291         defaultValueCreator: (bindable) =>
292         {
293             var viewStyle = (ViewStyle)bindable;
294             return viewStyle.siblingOrder;
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 static readonly BindableProperty ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
299         {
300             var viewStyle = (ViewStyle)bindable;
301             viewStyle.parentOrigin = (Position)newValue;
302         },
303         defaultValueCreator: (bindable) =>
304         {
305             var viewStyle = (ViewStyle)bindable;
306             return viewStyle.parentOrigin;
307         });
308         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
309         [EditorBrowsable(EditorBrowsableState.Never)]
310         public static readonly BindableProperty PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
311         {
312             var viewStyle = (ViewStyle)bindable;
313             viewStyle.pivotPoint = (Position)newValue;
314         },
315         defaultValueCreator: (bindable) =>
316         {
317             var viewStyle = (ViewStyle)bindable;
318             return viewStyle.pivotPoint;
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 static readonly BindableProperty SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
323         {
324             var viewStyle = (ViewStyle)bindable;
325             if (newValue != null)
326             {
327                 if (viewStyle.size == null)
328                 {
329                     viewStyle.size = new Size();
330                 }
331                 viewStyle.size.Width = (float)newValue;
332             }
333         },
334         defaultValueCreator: (bindable) =>
335         {
336             return ((ViewStyle)bindable).size?.Width;
337         });
338         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
339         [EditorBrowsable(EditorBrowsableState.Never)]
340         public static readonly BindableProperty SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
341         {
342             var viewStyle = (ViewStyle)bindable;
343             if (newValue != null)
344             {
345                 if (viewStyle.size == null)
346                 {
347                     viewStyle.size = new Size();
348                 }
349                 viewStyle.size.Height = (float)newValue;
350             }
351         },
352         defaultValueCreator: (bindable) =>
353         {
354             return ((ViewStyle)bindable).size?.Height;
355         });
356         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
357         [EditorBrowsable(EditorBrowsableState.Never)]
358         public static readonly BindableProperty PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
359         {
360             var viewStyle = (ViewStyle)bindable;
361             viewStyle.position = (Position)newValue;
362         },
363         defaultValueCreator: (bindable) =>
364         {
365             var viewStyle = (ViewStyle)bindable;
366             return viewStyle.position;
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 static readonly BindableProperty PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
371         {
372             var viewStyle = (ViewStyle)bindable;
373             if (newValue != null)
374             {
375                 if (viewStyle.position == null)
376                 {
377                     viewStyle.position = new Position();
378                 }
379                 viewStyle.position.X = (float)newValue;
380             }
381         },
382         defaultValueCreator: (bindable) =>
383         {
384             return ((ViewStyle)bindable).position?.X;
385         });
386         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
387         [EditorBrowsable(EditorBrowsableState.Never)]
388         public static readonly BindableProperty PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
389         {
390             var viewStyle = (ViewStyle)bindable;
391             if (newValue != null)
392             {
393                 if (viewStyle.position == null)
394                 {
395                     viewStyle.position = new Position();
396                 }
397                 viewStyle.position.Y = (float)newValue;
398             }
399         },
400         defaultValueCreator: (bindable) =>
401         {
402             return ((ViewStyle)bindable).position?.Y;
403         });
404         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
405         [EditorBrowsable(EditorBrowsableState.Never)]
406         public static readonly BindableProperty PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
407         {
408             var viewStyle = (ViewStyle)bindable;
409             if (newValue != null)
410             {
411                 if (viewStyle.position == null)
412                 {
413                     viewStyle.position = new Position();
414                 }
415                 viewStyle.position.Z = (float)newValue;
416             }
417         },
418         defaultValueCreator: (bindable) =>
419         {
420             return ((ViewStyle)bindable).position?.Z;
421         });
422         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
423         [EditorBrowsable(EditorBrowsableState.Never)]
424         public static readonly BindableProperty OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
425         {
426             var viewStyle = (ViewStyle)bindable;
427             viewStyle.orientation = (Rotation)newValue;
428         },
429         defaultValueCreator: (bindable) =>
430         {
431             var viewStyle = (ViewStyle)bindable;
432             return viewStyle.orientation;
433         });
434         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
435         [EditorBrowsable(EditorBrowsableState.Never)]
436         public static readonly BindableProperty ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
437         {
438             var viewStyle = (ViewStyle)bindable;
439             viewStyle.scale = (Vector3)newValue;
440         },
441         defaultValueCreator: (bindable) =>
442         {
443             var viewStyle = (ViewStyle)bindable;
444             return viewStyle.scale;
445         });
446         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
447         [EditorBrowsable(EditorBrowsableState.Never)]
448         public static readonly BindableProperty ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
449         {
450             var viewStyle = (ViewStyle)bindable;
451             if (newValue != null)
452             {
453                 if (viewStyle.scale == null)
454                 {
455                     viewStyle.scale = new Vector3();
456                 }
457                 viewStyle.scale.X = (float)newValue;
458             }
459         },
460         defaultValueCreator: (bindable) =>
461         {
462             return ((ViewStyle)bindable).scale?.X;
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 static readonly BindableProperty ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
467         {
468             var viewStyle = (ViewStyle)bindable;
469             if (newValue != null)
470             {
471                 if (viewStyle.scale == null)
472                 {
473                     viewStyle.scale = new Vector3();
474                 }
475                 viewStyle.scale.Y = (float)newValue;
476             }
477         },
478         defaultValueCreator: (bindable) =>
479         {
480             return ((ViewStyle)bindable).scale?.Y;
481         });
482         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
483         [EditorBrowsable(EditorBrowsableState.Never)]
484         public static readonly BindableProperty ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
485         {
486             var viewStyle = (ViewStyle)bindable;
487             if (newValue != null)
488             {
489                 if (viewStyle.scale == null)
490                 {
491                     viewStyle.scale = new Vector3();
492                 }
493                 viewStyle.scale.Z = (float)newValue;
494             }
495         },
496         defaultValueCreator: (bindable) =>
497         {
498             return ((ViewStyle)bindable).scale?.Z;
499         });
500         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
501         [EditorBrowsable(EditorBrowsableState.Never)]
502         public static readonly BindableProperty NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
503         {
504             var viewStyle = (ViewStyle)bindable;
505             viewStyle.name = (string)newValue;
506         },
507         defaultValueCreator: (bindable) =>
508         {
509             var viewStyle = (ViewStyle)bindable;
510             return viewStyle.name;
511         });
512         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
513         [EditorBrowsable(EditorBrowsableState.Never)]
514         public static readonly BindableProperty SensitiveProperty = BindableProperty.Create(nameof(Sensitive), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
515         {
516             var viewStyle = (ViewStyle)bindable;
517             viewStyle.sensitive = (bool?)newValue;
518         },
519         defaultValueCreator: (bindable) =>
520         {
521             var viewStyle = (ViewStyle)bindable;
522             return viewStyle.sensitive;
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 static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create(nameof(LeaveRequired), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
527         {
528             var viewStyle = (ViewStyle)bindable;
529             viewStyle.leaveRequired = (bool?)newValue;
530         },
531         defaultValueCreator: (bindable) =>
532         {
533             var viewStyle = (ViewStyle)bindable;
534             return viewStyle.leaveRequired;
535         });
536         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
537         [EditorBrowsable(EditorBrowsableState.Never)]
538         public static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create(nameof(InheritOrientation), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
539         {
540             var viewStyle = (ViewStyle)bindable;
541             viewStyle.inheritOrientation = (bool?)newValue;
542         },
543         defaultValueCreator: (bindable) =>
544         {
545             var viewStyle = (ViewStyle)bindable;
546             return viewStyle.inheritOrientation;
547         });
548         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
549         [EditorBrowsable(EditorBrowsableState.Never)]
550         public static readonly BindableProperty InheritScaleProperty = BindableProperty.Create(nameof(InheritScale), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
551         {
552             var viewStyle = (ViewStyle)bindable;
553             viewStyle.inheritScale = (bool?)newValue;
554         },
555         defaultValueCreator: (bindable) =>
556         {
557             var viewStyle = (ViewStyle)bindable;
558             return viewStyle.inheritScale;
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 static readonly BindableProperty DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
563         {
564             var viewStyle = (ViewStyle)bindable;
565             viewStyle.drawMode = (DrawModeType?)newValue;
566         },
567         defaultValueCreator: (bindable) =>
568         {
569             var viewStyle = (ViewStyle)bindable;
570             return viewStyle.drawMode;
571         });
572         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
573         [EditorBrowsable(EditorBrowsableState.Never)]
574         public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
575         {
576             var viewStyle = (ViewStyle)bindable;
577             viewStyle.sizeModeFactor = (Vector3)newValue;
578         },
579         defaultValueCreator: (bindable) =>
580         {
581             var viewStyle = (ViewStyle)bindable;
582             return viewStyle.sizeModeFactor;
583         });
584         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
585         [EditorBrowsable(EditorBrowsableState.Never)]
586         public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
587         {
588             var viewStyle = (ViewStyle)bindable;
589             viewStyle.widthResizePolicy = (ResizePolicyType?)newValue;
590         },
591         defaultValueCreator: (bindable) =>
592         {
593             var viewStyle = (ViewStyle)bindable;
594             return viewStyle.widthResizePolicy;
595         });
596         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
597         [EditorBrowsable(EditorBrowsableState.Never)]
598         public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
599         {
600             var viewStyle = (ViewStyle)bindable;
601             viewStyle.heightResizePolicy = (ResizePolicyType?)newValue;
602         },
603         defaultValueCreator: (bindable) =>
604         {
605             var viewStyle = (ViewStyle)bindable;
606             return viewStyle.heightResizePolicy;
607         });
608         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
609         [EditorBrowsable(EditorBrowsableState.Never)]
610         public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create(nameof(SizeScalePolicy), typeof(SizeScalePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
611         {
612             var viewStyle = (ViewStyle)bindable;
613             viewStyle.sizeScalePolicy = (SizeScalePolicyType?)newValue;
614         },
615         defaultValueCreator: (bindable) =>
616         {
617             var viewStyle = (ViewStyle)bindable;
618             return viewStyle.sizeScalePolicy;
619         });
620         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
621         [EditorBrowsable(EditorBrowsableState.Never)]
622         public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
623         {
624             var viewStyle = (ViewStyle)bindable;
625             viewStyle.widthForHeight = (bool?)newValue;
626         },
627         defaultValueCreator: (bindable) =>
628         {
629             var viewStyle = (ViewStyle)bindable;
630             return viewStyle.widthForHeight;
631         });
632         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
633         [EditorBrowsable(EditorBrowsableState.Never)]
634         public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
635         {
636             var viewStyle = (ViewStyle)bindable;
637             viewStyle.heightForWidth = (bool?)newValue;
638         },
639         defaultValueCreator: (bindable) =>
640         {
641             var viewStyle = (ViewStyle)bindable;
642             return viewStyle.heightForWidth;
643         });
644         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
645         [EditorBrowsable(EditorBrowsableState.Never)]
646         public static readonly BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
647         {
648             var viewStyle = (ViewStyle)bindable;
649             if (null == viewStyle.padding) viewStyle.padding = new Extents(viewStyle.OnPaddingChanged, 0, 0, 0, 0);
650             viewStyle.padding.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
651         },
652         defaultValueCreator: (bindable) =>
653         {
654             var viewStyle = (ViewStyle)bindable;
655             return viewStyle.padding;
656         });
657         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
658         [EditorBrowsable(EditorBrowsableState.Never)]
659         public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
660         {
661             var viewStyle = (ViewStyle)bindable;
662             viewStyle.minimumSize = (Size2D)newValue;
663         },
664         defaultValueCreator: (bindable) =>
665         {
666             var viewStyle = (ViewStyle)bindable;
667             return viewStyle.minimumSize;
668         });
669         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
670         [EditorBrowsable(EditorBrowsableState.Never)]
671         public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
672         {
673             var viewStyle = (ViewStyle)bindable;
674             viewStyle.maximumSize = (Size2D)newValue;
675         },
676         defaultValueCreator: (bindable) =>
677         {
678             var viewStyle = (ViewStyle)bindable;
679             return viewStyle.maximumSize;
680         });
681         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
682         [EditorBrowsable(EditorBrowsableState.Never)]
683         public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create(nameof(InheritPosition), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
684         {
685             var viewStyle = (ViewStyle)bindable;
686             viewStyle.inheritPosition = (bool?)newValue;
687         },
688         defaultValueCreator: (bindable) =>
689         {
690             var viewStyle = (ViewStyle)bindable;
691             return viewStyle.inheritPosition;
692         });
693         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
694         [EditorBrowsable(EditorBrowsableState.Never)]
695         public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
696         {
697             var viewStyle = (ViewStyle)bindable;
698             viewStyle.clippingMode = (ClippingModeType?)newValue;
699         },
700         defaultValueCreator: (bindable) =>
701         {
702             var viewStyle = (ViewStyle)bindable;
703             return viewStyle.clippingMode;
704         });
705         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
706         [EditorBrowsable(EditorBrowsableState.Never)]
707         public static readonly BindableProperty SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
708         {
709             var viewStyle = (ViewStyle)bindable;
710             viewStyle.size = (Size)newValue;
711         },
712         defaultValueCreator: (bindable) =>
713         {
714             var viewStyle = (ViewStyle)bindable;
715             return viewStyle.size;
716         });
717         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
718         [EditorBrowsable(EditorBrowsableState.Never)]
719         public static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create(nameof(InheritLayoutDirection), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
720         {
721             var viewStyle = (ViewStyle)bindable;
722             viewStyle.inheritLayoutDirection = (bool?)newValue;
723         },
724         defaultValueCreator: (bindable) =>
725         {
726             var viewStyle = (ViewStyle)bindable;
727             return viewStyle.inheritLayoutDirection;
728         });
729         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
730         [EditorBrowsable(EditorBrowsableState.Never)]
731         public static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create(nameof(LayoutDirection), typeof(ViewLayoutDirectionType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
732         {
733             var viewStyle = (ViewStyle)bindable;
734             viewStyle.layoutDirection = (ViewLayoutDirectionType?)newValue;
735         },
736         defaultValueCreator: (bindable) =>
737         {
738             var viewStyle = (ViewStyle)bindable;
739             return viewStyle.layoutDirection;
740         });
741         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
742         [EditorBrowsable(EditorBrowsableState.Never)]
743         public static readonly BindableProperty MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
744         {
745             var viewStyle = (ViewStyle)bindable;
746             if (null == viewStyle.margin) viewStyle.margin = new Extents(viewStyle.OnMarginChanged, 0, 0, 0, 0);
747             viewStyle.margin.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
748         },
749         defaultValueCreator: (bindable) =>
750         {
751             var viewStyle = (ViewStyle)bindable;
752             return viewStyle.margin;
753         });
754         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
755         [EditorBrowsable(EditorBrowsableState.Never)]
756         public static readonly BindableProperty WeightProperty = BindableProperty.Create(nameof(Weight), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
757         {
758             var viewStyle = (ViewStyle)bindable;
759             viewStyle.weight = (float?)newValue;
760         },
761         defaultValueCreator: (bindable) =>
762         {
763             var viewStyle = (ViewStyle)bindable;
764             return viewStyle.weight;
765         });
766         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
767         [EditorBrowsable(EditorBrowsableState.Never)]
768         public static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
769         {
770             var viewStyle = (ViewStyle)bindable;
771             
772             if (newValue == null)
773             {
774                 viewStyle.backgroundColorSelector = null;
775             }
776             else
777             {
778                 viewStyle.backgroundColorSelector = ((Selector<Color>)newValue).Clone();
779                 viewStyle.backgroundImageSelector = null;
780             }
781             
782         },
783         defaultValueCreator: (bindable) =>
784         {
785             var viewStyle = (ViewStyle)bindable;
786             return viewStyle.backgroundColorSelector;
787         });
788
789         [EditorBrowsable(EditorBrowsableState.Never)]
790         public static readonly BindableProperty ColorSelectorProperty = BindableProperty.Create("ColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
791         {
792             ((ViewStyle)bindable).colorSelector = ((Selector<Color>)newValue)?.Clone();
793         },
794         defaultValueCreator: (bindable) =>
795         {
796             var viewStyle = (ViewStyle)bindable;
797             return viewStyle.colorSelector;
798         });
799
800         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
801         [EditorBrowsable(EditorBrowsableState.Never)]
802         public static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
803         {
804             ((ViewStyle)bindable).backgroundImageBorderSelector = ((Selector<Rectangle>)newValue)?.Clone();
805         },
806         defaultValueCreator: (bindable) =>
807         {
808             var viewStyle = (ViewStyle)bindable;
809             return viewStyle.backgroundImageBorderSelector;
810         });
811
812         /// A BindableProperty for ImageShadow
813         [EditorBrowsable(EditorBrowsableState.Never)]
814         public static readonly BindableProperty ImageShadowSelectorProperty = BindableProperty.Create("ImageShadowSelector", typeof(Selector<ImageShadow>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
815         {
816             var viewStyle = (ViewStyle)bindable;
817
818             viewStyle.imageShadow = ((Selector<ImageShadow>)newValue)?.Clone();
819             viewStyle.boxShadow = null;
820         },
821         defaultValueCreator: (bindable) =>
822         {
823             var viewStyle = (ViewStyle)bindable;
824             return viewStyle.imageShadow;
825         });
826
827         /// A BindableProperty for BoxShadow
828         [EditorBrowsable(EditorBrowsableState.Never)]
829         public static readonly BindableProperty BoxShadowSelectorProperty = BindableProperty.Create("BoxShadowSelector", typeof(Selector<Shadow>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
830         {
831             var viewStyle = (ViewStyle)bindable;
832
833             viewStyle.boxShadow = ((Selector<Shadow>)newValue)?.Clone();
834             viewStyle.imageShadow = null;
835         },
836         defaultValueCreator: (bindable) =>
837         {
838             var viewStyle = (ViewStyle)bindable;
839             return viewStyle.boxShadow;
840         });
841
842         /// A BindableProperty for CornerRadius
843         [EditorBrowsable(EditorBrowsableState.Never)]
844         public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create("CornerRadiusSelector", typeof(Selector<float?>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
845         {
846             ((ViewStyle)bindable).cornerRadius = ((Selector<float?>)(newValue))?.Clone();
847         },
848         defaultValueCreator: (bindable) =>
849         {
850             var viewStyle = (ViewStyle)bindable;
851             return viewStyle.cornerRadius;
852         });
853
854         /// <summary>
855         /// EnableControlState property
856         /// </summary>
857         [EditorBrowsable(EditorBrowsableState.Never)]
858         public static readonly BindableProperty EnableControlStateProperty = BindableProperty.Create("EnableControlState", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
859         {
860             ((ViewStyle)bindable).enableControlState = (bool?)newValue;
861         },
862         defaultValueCreator: (bindable) =>
863         {
864             return ((ViewStyle)bindable).enableControlState;
865         });
866     }
867 }