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