8f0a3ad16970d70a326b8e9595a6d68459fa724d
[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                     if ((float)newValue == 0) return;
330                 }
331                 viewStyle.size = new Size((float)newValue, viewStyle.size?.Height ?? 0);
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                     if ((float)newValue == 0) return;
348                 }
349                 viewStyle.size = new Size(viewStyle.size?.Width ?? 0, (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             if (viewStyle.position != null && viewStyle.position.X == 0 && viewStyle.position.Y == 0)
363             {
364                 viewStyle.position = null;
365             }
366         },
367         defaultValueCreator: (bindable) =>
368         {
369             var viewStyle = (ViewStyle)bindable;
370             return viewStyle.position;
371         });
372         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
373         [EditorBrowsable(EditorBrowsableState.Never)]
374         public static readonly BindableProperty PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
375         {
376             var viewStyle = (ViewStyle)bindable;
377             if (newValue != null)
378             {
379                 if (viewStyle.position == null)
380                 {
381                     if ((float)newValue == 0) return;
382                 }
383                 viewStyle.position = new Position((float)newValue, viewStyle.position?.Y ?? 0);
384             }
385         },
386         defaultValueCreator: (bindable) =>
387         {
388             return ((ViewStyle)bindable).position?.X;
389         });
390         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
391         [EditorBrowsable(EditorBrowsableState.Never)]
392         public static readonly BindableProperty PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
393         {
394             var viewStyle = (ViewStyle)bindable;
395             if (newValue != null)
396             {
397                 if (viewStyle.position == null)
398                 {
399                     if ((float)newValue == 0) return;
400                 }
401                 viewStyle.position = new Position(viewStyle.position?.X ?? 0, (float)newValue);
402             }
403         },
404         defaultValueCreator: (bindable) =>
405         {
406             return ((ViewStyle)bindable).position?.Y;
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 static readonly BindableProperty PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
411         {
412             var viewStyle = (ViewStyle)bindable;
413             if (newValue != null)
414             {
415                 if (viewStyle.position == null)
416                 {
417                     if ((float)newValue == 0) return;
418                 }
419                 viewStyle.position = new Position(viewStyle.Position?.X ?? 0, viewStyle.Position?.Y ?? 0, (float)newValue);
420             }
421         },
422         defaultValueCreator: (bindable) =>
423         {
424             return ((ViewStyle)bindable).position?.Z;
425         });
426         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
427         [EditorBrowsable(EditorBrowsableState.Never)]
428         public static readonly BindableProperty OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
429         {
430             var viewStyle = (ViewStyle)bindable;
431             viewStyle.orientation = (Rotation)newValue;
432         },
433         defaultValueCreator: (bindable) =>
434         {
435             var viewStyle = (ViewStyle)bindable;
436             return viewStyle.orientation;
437         });
438         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
439         [EditorBrowsable(EditorBrowsableState.Never)]
440         public static readonly BindableProperty ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
441         {
442             var viewStyle = (ViewStyle)bindable;
443             viewStyle.scale = (Vector3)newValue;
444             if (viewStyle.scale != null && viewStyle.scale.X == 1.0f && viewStyle.scale.Y == 1.0f && viewStyle.scale.Z == 1.0f) return;
445         },
446         defaultValueCreator: (bindable) =>
447         {
448             var viewStyle = (ViewStyle)bindable;
449             return viewStyle.scale;
450         });
451         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
452         [EditorBrowsable(EditorBrowsableState.Never)]
453         public static readonly BindableProperty ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
454         {
455             var viewStyle = (ViewStyle)bindable;
456             if (newValue != null)
457             {
458                 if (viewStyle.scale == null)
459                 {
460                     if ((float)newValue == 1.0f) return;
461                 }
462                 viewStyle.scale = new Vector3((float)newValue, viewStyle.scale?.Y ?? 0, viewStyle.scale?.Z ?? 0);
463             }
464         },
465         defaultValueCreator: (bindable) =>
466         {
467             return ((ViewStyle)bindable).scale?.X;
468         });
469         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
470         [EditorBrowsable(EditorBrowsableState.Never)]
471         public static readonly BindableProperty ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
472         {
473             var viewStyle = (ViewStyle)bindable;
474             if (newValue != null)
475             {
476                 if (viewStyle.scale == null)
477                 {
478                     if ((float)newValue == 1.0f) return;
479                 }
480                 viewStyle.scale = new Vector3(viewStyle.scale?.X ?? 0, (float)newValue, viewStyle.scale?.Z ?? 0);
481             }
482         },
483         defaultValueCreator: (bindable) =>
484         {
485             return ((ViewStyle)bindable).scale?.Y;
486         });
487         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
488         [EditorBrowsable(EditorBrowsableState.Never)]
489         public static readonly BindableProperty ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
490         {
491             var viewStyle = (ViewStyle)bindable;
492             if (newValue != null)
493             {
494                 if (viewStyle.scale == null)
495                 {
496                     if ((float)newValue == 1.0f) return;
497                 }
498                 viewStyle.scale = new Vector3(viewStyle.scale?.X ?? 0, viewStyle.scale?.Y ?? 0, (float)newValue);
499             }
500         },
501         defaultValueCreator: (bindable) =>
502         {
503             return ((ViewStyle)bindable).scale?.Z;
504         });
505         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
506         [EditorBrowsable(EditorBrowsableState.Never)]
507         public static readonly BindableProperty NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
508         {
509             var viewStyle = (ViewStyle)bindable;
510             viewStyle.name = (string)newValue;
511         },
512         defaultValueCreator: (bindable) =>
513         {
514             var viewStyle = (ViewStyle)bindable;
515             return viewStyle.name;
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 static readonly BindableProperty SensitiveProperty = BindableProperty.Create(nameof(Sensitive), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
520         {
521             var viewStyle = (ViewStyle)bindable;
522             viewStyle.sensitive = (bool?)newValue;
523         },
524         defaultValueCreator: (bindable) =>
525         {
526             var viewStyle = (ViewStyle)bindable;
527             return viewStyle.sensitive;
528         });
529         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
530         [EditorBrowsable(EditorBrowsableState.Never)]
531         public static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create(nameof(LeaveRequired), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
532         {
533             var viewStyle = (ViewStyle)bindable;
534             viewStyle.leaveRequired = (bool?)newValue;
535         },
536         defaultValueCreator: (bindable) =>
537         {
538             var viewStyle = (ViewStyle)bindable;
539             return viewStyle.leaveRequired;
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 static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create(nameof(InheritOrientation), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
544         {
545             var viewStyle = (ViewStyle)bindable;
546             viewStyle.inheritOrientation = (bool?)newValue;
547         },
548         defaultValueCreator: (bindable) =>
549         {
550             var viewStyle = (ViewStyle)bindable;
551             return viewStyle.inheritOrientation;
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 static readonly BindableProperty InheritScaleProperty = BindableProperty.Create(nameof(InheritScale), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
556         {
557             var viewStyle = (ViewStyle)bindable;
558             viewStyle.inheritScale = (bool?)newValue;
559         },
560         defaultValueCreator: (bindable) =>
561         {
562             var viewStyle = (ViewStyle)bindable;
563             return viewStyle.inheritScale;
564         });
565         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
566         [EditorBrowsable(EditorBrowsableState.Never)]
567         public static readonly BindableProperty DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
568         {
569             var viewStyle = (ViewStyle)bindable;
570             viewStyle.drawMode = (DrawModeType?)newValue;
571         },
572         defaultValueCreator: (bindable) =>
573         {
574             var viewStyle = (ViewStyle)bindable;
575             return viewStyle.drawMode;
576         });
577         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
578         [EditorBrowsable(EditorBrowsableState.Never)]
579         public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
580         {
581             var viewStyle = (ViewStyle)bindable;
582             viewStyle.sizeModeFactor = (Vector3)newValue;
583         },
584         defaultValueCreator: (bindable) =>
585         {
586             var viewStyle = (ViewStyle)bindable;
587             return viewStyle.sizeModeFactor;
588         });
589         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
590         [EditorBrowsable(EditorBrowsableState.Never)]
591         public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
592         {
593             var viewStyle = (ViewStyle)bindable;
594             viewStyle.widthResizePolicy = (ResizePolicyType?)newValue;
595         },
596         defaultValueCreator: (bindable) =>
597         {
598             var viewStyle = (ViewStyle)bindable;
599             return viewStyle.widthResizePolicy;
600         });
601         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
602         [EditorBrowsable(EditorBrowsableState.Never)]
603         public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
604         {
605             var viewStyle = (ViewStyle)bindable;
606             viewStyle.heightResizePolicy = (ResizePolicyType?)newValue;
607         },
608         defaultValueCreator: (bindable) =>
609         {
610             var viewStyle = (ViewStyle)bindable;
611             return viewStyle.heightResizePolicy;
612         });
613         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
614         [EditorBrowsable(EditorBrowsableState.Never)]
615         public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create(nameof(SizeScalePolicy), typeof(SizeScalePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
616         {
617             var viewStyle = (ViewStyle)bindable;
618             viewStyle.sizeScalePolicy = (SizeScalePolicyType?)newValue;
619         },
620         defaultValueCreator: (bindable) =>
621         {
622             var viewStyle = (ViewStyle)bindable;
623             return viewStyle.sizeScalePolicy;
624         });
625         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
626         [EditorBrowsable(EditorBrowsableState.Never)]
627         public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
628         {
629             var viewStyle = (ViewStyle)bindable;
630             viewStyle.widthForHeight = (bool?)newValue;
631         },
632         defaultValueCreator: (bindable) =>
633         {
634             var viewStyle = (ViewStyle)bindable;
635             return viewStyle.widthForHeight;
636         });
637         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
638         [EditorBrowsable(EditorBrowsableState.Never)]
639         public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
640         {
641             var viewStyle = (ViewStyle)bindable;
642             viewStyle.heightForWidth = (bool?)newValue;
643         },
644         defaultValueCreator: (bindable) =>
645         {
646             var viewStyle = (ViewStyle)bindable;
647             return viewStyle.heightForWidth;
648         });
649         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
650         [EditorBrowsable(EditorBrowsableState.Never)]
651         public static readonly BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
652         {
653             var viewStyle = (ViewStyle)bindable;
654             if (null == viewStyle.padding) viewStyle.padding = new Extents(viewStyle.OnPaddingChanged, 0, 0, 0, 0);
655             viewStyle.padding.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
656         },
657         defaultValueCreator: (bindable) =>
658         {
659             var viewStyle = (ViewStyle)bindable;
660             return viewStyle.padding;
661         });
662         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
663         [EditorBrowsable(EditorBrowsableState.Never)]
664         public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
665         {
666             var viewStyle = (ViewStyle)bindable;
667             viewStyle.minimumSize = (Size2D)newValue;
668         },
669         defaultValueCreator: (bindable) =>
670         {
671             var viewStyle = (ViewStyle)bindable;
672             return viewStyle.minimumSize;
673         });
674         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
675         [EditorBrowsable(EditorBrowsableState.Never)]
676         public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
677         {
678             var viewStyle = (ViewStyle)bindable;
679             viewStyle.maximumSize = (Size2D)newValue;
680         },
681         defaultValueCreator: (bindable) =>
682         {
683             var viewStyle = (ViewStyle)bindable;
684             return viewStyle.maximumSize;
685         });
686         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
687         [EditorBrowsable(EditorBrowsableState.Never)]
688         public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create(nameof(InheritPosition), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
689         {
690             var viewStyle = (ViewStyle)bindable;
691             viewStyle.inheritPosition = (bool?)newValue;
692         },
693         defaultValueCreator: (bindable) =>
694         {
695             var viewStyle = (ViewStyle)bindable;
696             return viewStyle.inheritPosition;
697         });
698         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
699         [EditorBrowsable(EditorBrowsableState.Never)]
700         public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
701         {
702             var viewStyle = (ViewStyle)bindable;
703             viewStyle.clippingMode = (ClippingModeType?)newValue;
704         },
705         defaultValueCreator: (bindable) =>
706         {
707             var viewStyle = (ViewStyle)bindable;
708             return viewStyle.clippingMode;
709         });
710         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
711         [EditorBrowsable(EditorBrowsableState.Never)]
712         public static readonly BindableProperty SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
713         {
714             var viewStyle = (ViewStyle)bindable;
715             viewStyle.size = (Size)newValue;
716             if (viewStyle.size != null && viewStyle.size.Width == 0 && viewStyle.size.Height == 0)
717             {
718                 viewStyle.size = null;
719             }
720         },
721         defaultValueCreator: (bindable) =>
722         {
723             var viewStyle = (ViewStyle)bindable;
724             return viewStyle.size;
725         });
726         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
727         [EditorBrowsable(EditorBrowsableState.Never)]
728         public static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create(nameof(InheritLayoutDirection), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
729         {
730             var viewStyle = (ViewStyle)bindable;
731             viewStyle.inheritLayoutDirection = (bool?)newValue;
732         },
733         defaultValueCreator: (bindable) =>
734         {
735             var viewStyle = (ViewStyle)bindable;
736             return viewStyle.inheritLayoutDirection;
737         });
738         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
739         [EditorBrowsable(EditorBrowsableState.Never)]
740         public static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create(nameof(LayoutDirection), typeof(ViewLayoutDirectionType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
741         {
742             var viewStyle = (ViewStyle)bindable;
743             viewStyle.layoutDirection = (ViewLayoutDirectionType?)newValue;
744         },
745         defaultValueCreator: (bindable) =>
746         {
747             var viewStyle = (ViewStyle)bindable;
748             return viewStyle.layoutDirection;
749         });
750         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
751         [EditorBrowsable(EditorBrowsableState.Never)]
752         public static readonly BindableProperty MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
753         {
754             var viewStyle = (ViewStyle)bindable;
755             if (null == viewStyle.margin) viewStyle.margin = new Extents(viewStyle.OnMarginChanged, 0, 0, 0, 0);
756             viewStyle.margin.CopyFrom(null == newValue ? new Extents() : (Extents)newValue);
757         },
758         defaultValueCreator: (bindable) =>
759         {
760             var viewStyle = (ViewStyle)bindable;
761             return viewStyle.margin;
762         });
763         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
764         [EditorBrowsable(EditorBrowsableState.Never)]
765         public static readonly BindableProperty WeightProperty = BindableProperty.Create(nameof(Weight), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
766         {
767             var viewStyle = (ViewStyle)bindable;
768             viewStyle.weight = (float?)newValue;
769         },
770         defaultValueCreator: (bindable) =>
771         {
772             var viewStyle = (ViewStyle)bindable;
773             return viewStyle.weight;
774         });
775         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
776         [EditorBrowsable(EditorBrowsableState.Never)]
777         public static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
778         {
779             var viewStyle = (ViewStyle)bindable;
780
781             if (newValue == null)
782             {
783                 viewStyle.backgroundColorSelector = null;
784             }
785             else
786             {
787                 viewStyle.backgroundColorSelector = ((Selector<Color>)newValue).Clone();
788                 viewStyle.backgroundImageSelector = null;
789             }
790
791         },
792         defaultValueCreator: (bindable) =>
793         {
794             var viewStyle = (ViewStyle)bindable;
795             return viewStyle.backgroundColorSelector;
796         });
797
798         [EditorBrowsable(EditorBrowsableState.Never)]
799         public static readonly BindableProperty ColorSelectorProperty = BindableProperty.Create("ColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
800         {
801             ((ViewStyle)bindable).colorSelector = ((Selector<Color>)newValue)?.Clone();
802         },
803         defaultValueCreator: (bindable) =>
804         {
805             var viewStyle = (ViewStyle)bindable;
806             return viewStyle.colorSelector;
807         });
808
809         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
810         [EditorBrowsable(EditorBrowsableState.Never)]
811         public static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
812         {
813             ((ViewStyle)bindable).backgroundImageBorderSelector = ((Selector<Rectangle>)newValue)?.Clone();
814         },
815         defaultValueCreator: (bindable) =>
816         {
817             var viewStyle = (ViewStyle)bindable;
818             return viewStyle.backgroundImageBorderSelector;
819         });
820
821         /// A BindableProperty for ImageShadow
822         [EditorBrowsable(EditorBrowsableState.Never)]
823         public static readonly BindableProperty ImageShadowSelectorProperty = BindableProperty.Create("ImageShadowSelector", typeof(Selector<ImageShadow>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
824         {
825             var viewStyle = (ViewStyle)bindable;
826
827             viewStyle.imageShadow = ((Selector<ImageShadow>)newValue)?.Clone();
828
829             if (viewStyle.imageShadow != null)
830             {
831                 viewStyle.boxShadow = null;
832             }
833         },
834         defaultValueCreator: (bindable) =>
835         {
836             var viewStyle = (ViewStyle)bindable;
837             return viewStyle.imageShadow;
838         });
839
840         /// A BindableProperty for BoxShadow
841         [EditorBrowsable(EditorBrowsableState.Never)]
842         public static readonly BindableProperty BoxShadowSelectorProperty = BindableProperty.Create("BoxShadowSelector", typeof(Selector<Shadow>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
843         {
844             var viewStyle = (ViewStyle)bindable;
845
846             viewStyle.boxShadow = ((Selector<Shadow>)newValue)?.Clone();
847
848             if (viewStyle.boxShadow != null)
849             {
850                 viewStyle.imageShadow = null;
851             }
852         },
853         defaultValueCreator: (bindable) =>
854         {
855             var viewStyle = (ViewStyle)bindable;
856             return viewStyle.boxShadow;
857         });
858
859         /// A BindableProperty for CornerRadius
860         [EditorBrowsable(EditorBrowsableState.Never)]
861         public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create("CornerRadiusSelector", typeof(Selector<float?>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
862         {
863             ((ViewStyle)bindable).cornerRadius = ((Selector<float?>)(newValue))?.Clone();
864         },
865         defaultValueCreator: (bindable) =>
866         {
867             var viewStyle = (ViewStyle)bindable;
868             return viewStyle.cornerRadius;
869         });
870
871         /// <summary> A BindableProperty for CornerRadiusPolicy </summary>
872         [EditorBrowsable(EditorBrowsableState.Never)]
873         public static readonly BindableProperty CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType?), typeof(ViewStyle), null,
874             propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).cornerRadiusPolicy = (VisualTransformPolicyType?)newValue,
875             defaultValueCreator: (bindable) => ((ViewStyle)bindable).cornerRadiusPolicy
876         );
877
878         /// <summary>
879         /// EnableControlState property
880         /// </summary>
881         [EditorBrowsable(EditorBrowsableState.Never)]
882         public static readonly BindableProperty EnableControlStateProperty = BindableProperty.Create(nameof(EnableControlState), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
883         {
884             ((ViewStyle)bindable).enableControlState = (bool?)newValue;
885         },
886         defaultValueCreator: (bindable) =>
887         {
888             return ((ViewStyle)bindable).enableControlState;
889         });
890
891         /// <summary>
892         /// EnableControlState property
893         /// </summary>
894         [EditorBrowsable(EditorBrowsableState.Never)]
895         public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
896         {
897             ((ViewStyle)bindable).themeChangeSensitive = (bool?)newValue;
898         },
899         defaultValueCreator: (bindable) =>
900         {
901             return ((ViewStyle)bindable).themeChangeSensitive;
902         });
903     }
904 }