[NUI] remove "_" and refactoring naming to pascal case.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewBindableProperty.cs
1 /*
2  * Copyright(c) 2019 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
18 using System.ComponentModel;
19 using Tizen.NUI.Binding;
20
21 namespace Tizen.NUI.BaseComponents
22 {
23     /// <summary>
24     /// View is the base class for all views.
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     public partial class View
28     {
29         /// <summary>
30         /// StyleNameProperty (DALi json)
31         /// </summary>
32         [EditorBrowsable(EditorBrowsableState.Never)]
33         public static readonly BindableProperty StyleNameProperty = BindableProperty.Create(nameof(StyleName), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
34         {
35             var view = (View)bindable;
36             if (newValue != null)
37             {
38                 string styleName = (string)newValue;
39                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.StyleName, new Tizen.NUI.PropertyValue(styleName));
40
41                 view.styleName = styleName;
42                 view.UpdateStyle();
43                 view.ThemeChangeSensitive = true;
44             }
45         },
46         defaultValueCreator: (bindable) =>
47         {
48             var view = (View)bindable;
49
50             if (!string.IsNullOrEmpty(view.styleName)) return view.styleName;
51
52             string temp;
53             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.StyleName).Get(out temp);
54             return temp;
55         });
56
57         /// <summary>
58         /// KeyInputFocusProperty
59         /// </summary>
60         [EditorBrowsable(EditorBrowsableState.Never)]
61         public static readonly BindableProperty KeyInputFocusProperty = BindableProperty.Create(nameof(KeyInputFocus), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
62         {
63             var view = (View)bindable;
64             if (newValue != null)
65             {
66                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.KeyInputFocus, new Tizen.NUI.PropertyValue((bool)newValue));
67             }
68         },
69         defaultValueCreator: (bindable) =>
70         {
71             var view = (View)bindable;
72             bool temp = false;
73             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.KeyInputFocus).Get(out temp);
74             return temp;
75         });
76
77         /// <summary>
78         /// BackgroundColorProperty
79         /// </summary>
80         [EditorBrowsable(EditorBrowsableState.Never)]
81         public static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
82         {
83             var view = (View)bindable;
84             if (newValue != null)
85             {
86                 if (view.backgroundExtraData == null)
87                 {
88                     Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new PropertyValue((Color)newValue));
89                     return;
90                 }
91
92                 PropertyMap map = new PropertyMap();
93
94                 map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color))
95                    .Add(ColorVisualProperty.MixColor, new PropertyValue((Color)newValue))
96                    .Add(Visual.Property.CornerRadius, new PropertyValue(view.backgroundExtraData.CornerRadius));
97
98                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new PropertyValue(map));
99             }
100         },
101         defaultValueCreator: (bindable) =>
102         {
103             var view = (View)bindable;
104             Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
105
106             Tizen.NUI.PropertyMap background = view.Background;
107             int visualType = 0;
108             background.Find(Visual.Property.Type)?.Get(out visualType);
109             if (visualType == (int)Visual.Type.Color)
110             {
111                 background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor);
112             }
113
114             return backgroundColor;
115         });
116
117         /// <summary>
118         /// ColorProperty
119         /// </summary>
120         [EditorBrowsable(EditorBrowsableState.Never)]
121         public static readonly BindableProperty ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
122         {
123             var view = (View)bindable;
124             if (newValue != null)
125             {
126                 view.SetColor((Color)newValue);
127             }
128         },
129         defaultValueCreator: (bindable) =>
130         {
131             var view = (View)bindable;
132             Color color = new Color(0.0f, 0.0f, 0.0f, 0.0f);
133             view.GetProperty(Interop.ActorProperty.ColorGet()).Get(color);
134             return color;
135         });
136
137         /// <summary> BackgroundImageProperty </summary>
138         [EditorBrowsable(EditorBrowsableState.Never)]
139         public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create(nameof(BackgroundImage), typeof(string), typeof(View), default(string), propertyChanged: (bindable, oldValue, newValue) =>
140         {
141             var view = (View)bindable;
142             if (newValue != null)
143             {
144                 string url = (string)newValue;
145
146                 if (string.IsNullOrEmpty(url))
147                 {
148                     // Clear background
149                     Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new PropertyValue());
150                     return;
151                 }
152
153                 if (view.backgroundExtraData == null)
154                 {
155                     Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new PropertyValue(url));
156                     view.BackgroundImageSynchronosLoading = view._backgroundImageSynchronosLoading;
157
158                     return;
159                 }
160
161                 PropertyMap map = new PropertyMap();
162
163                 map.Add(ImageVisualProperty.URL, new PropertyValue(url))
164                    .Add(Visual.Property.CornerRadius, new PropertyValue(view.backgroundExtraData.CornerRadius))
165                    .Add(ImageVisualProperty.SynchronousLoading, new PropertyValue(view._backgroundImageSynchronosLoading));
166
167                 if (view.backgroundExtraData.BackgroundImageBorder != null)
168                 {
169                     map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch))
170                        .Add(NpatchImageVisualProperty.Border, new PropertyValue(view.backgroundExtraData.BackgroundImageBorder));
171                 }
172                 else
173                 {
174                     map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
175                 }
176
177                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new PropertyValue(map));
178             }
179         },
180         defaultValueCreator: (bindable) =>
181         {
182             var view = (View)bindable;
183             string backgroundImage = "";
184
185             Tizen.NUI.PropertyMap background = view.Background;
186             background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage);
187
188             return backgroundImage;
189         });
190         /// <summary>BackgroundImageBorderProperty</summary>
191         [EditorBrowsable(EditorBrowsableState.Never)]
192         public static readonly BindableProperty BackgroundImageBorderProperty = BindableProperty.Create(nameof(BackgroundImageBorder), typeof(Rectangle), typeof(View), default(Rectangle), propertyChanged: (bindable, oldValue, newValue) =>
193         {
194             var view = (View)bindable;
195
196             bool isEmptyValue = Rectangle.IsNullOrZero((Rectangle)newValue);
197
198             var backgroundImageBorder = isEmptyValue ? null : (Rectangle)newValue;
199
200             (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BackgroundImageBorder = backgroundImageBorder;
201
202             if (isEmptyValue)
203             {
204                 return;
205             }
206
207             PropertyMap map = view.Background;
208
209             if (map.Empty())
210             {
211                 return;
212             }
213
214             map[NpatchImageVisualProperty.Border] = new PropertyValue(backgroundImageBorder);
215
216             int visualType = 0;
217
218             map.Find(Visual.Property.Type)?.Get(out visualType);
219
220             if (visualType == (int)Visual.Type.Image)
221             {
222                 map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.NPatch);
223             }
224
225             Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new PropertyValue(map));
226
227         },
228         defaultValueCreator: (bindable) =>
229         {
230             var view = (View)bindable;
231
232             return view.backgroundExtraData?.BackgroundImageBorder;
233         });
234         /// <summary>
235         /// BackgroundProperty
236         /// </summary>
237         [EditorBrowsable(EditorBrowsableState.Never)]
238         public static readonly BindableProperty BackgroundProperty = BindableProperty.Create(nameof(Background), typeof(PropertyMap), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
239         {
240             var view = (View)bindable;
241             if (newValue != null)
242             {
243                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
244
245                 view.backgroundExtraData = null;
246             }
247         },
248         defaultValueCreator: (bindable) =>
249         {
250             var view = (View)bindable;
251             Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
252             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.BACKGROUND).Get(temp);
253             return temp;
254         });
255
256         /// <summary>
257         /// StateProperty
258         /// </summary>
259         [EditorBrowsable(EditorBrowsableState.Never)]
260         public static readonly BindableProperty StateProperty = BindableProperty.Create(nameof(State), typeof(States), typeof(View), States.Normal, propertyChanged: (bindable, oldValue, newValue) =>
261         {
262             var view = (View)bindable;
263             if (newValue != null)
264             {
265                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STATE, new Tizen.NUI.PropertyValue((int)newValue));
266             }
267         },
268         defaultValueCreator: (bindable) =>
269         {
270             var view = (View)bindable;
271             int temp = 0;
272             if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STATE).Get(out temp) == false)
273             {
274                 NUILog.Error("State get error!");
275             }
276             switch (temp)
277             {
278                 case 0: return States.Normal;
279                 case 1: return States.Focused;
280                 case 2: return States.Disabled;
281                 default: return States.Normal;
282             }
283         });
284
285         /// <summary>
286         /// SubStateProperty
287         /// </summary>
288         [EditorBrowsable(EditorBrowsableState.Never)]
289         public static readonly BindableProperty SubStateProperty = BindableProperty.Create(nameof(SubState), typeof(States), typeof(View), States.Normal, propertyChanged: (bindable, oldValue, newValue) =>
290         {
291             var view = (View)bindable;
292             string valueToString = "";
293             if (newValue != null)
294             {
295                 valueToString = ((States)newValue).GetDescription<States>();
296                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SubState, new Tizen.NUI.PropertyValue(valueToString));
297             }
298         },
299         defaultValueCreator: (bindable) =>
300         {
301             var view = (View)bindable;
302             string temp;
303             if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SubState).Get(out temp) == false)
304             {
305                 NUILog.Error("subState get error!");
306             }
307             return temp.GetValueByDescription<States>();
308         });
309
310         /// <summary>
311         /// TooltipProperty
312         /// </summary>
313         [EditorBrowsable(EditorBrowsableState.Never)]
314         public static readonly BindableProperty TooltipProperty = BindableProperty.Create(nameof(Tooltip), typeof(PropertyMap), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
315         {
316             var view = (View)bindable;
317             if (newValue != null)
318             {
319                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
320             }
321         },
322         defaultValueCreator: (bindable) =>
323         {
324             var view = (View)bindable;
325             Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
326             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.TOOLTIP).Get(temp);
327             return temp;
328         });
329
330         /// <summary>
331         /// FlexProperty
332         /// </summary>
333         [EditorBrowsable(EditorBrowsableState.Never)]
334         public static readonly BindableProperty FlexProperty = BindableProperty.Create(nameof(Flex), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
335         {
336             var view = (View)bindable;
337             if (newValue != null)
338             {
339                 Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue((float)newValue));
340             }
341         },
342         defaultValueCreator: (bindable) =>
343         {
344             var view = (View)bindable;
345             float temp = 0.0f;
346             Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX).Get(out temp);
347             return temp;
348         });
349
350         /// <summary>
351         /// AlignSelfProperty
352         /// </summary>
353         [EditorBrowsable(EditorBrowsableState.Never)]
354         public static readonly BindableProperty AlignSelfProperty = BindableProperty.Create(nameof(AlignSelf), typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) =>
355         {
356             var view = (View)bindable;
357             if (newValue != null)
358             {
359                 Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.AlignSelf, new Tizen.NUI.PropertyValue((int)newValue));
360             }
361         },
362         defaultValueCreator: (bindable) =>
363         {
364             var view = (View)bindable;
365             int temp = 0;
366             Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.AlignSelf).Get(out temp);
367             return temp;
368         });
369
370         /// <summary>
371         /// FlexMarginProperty
372         /// </summary>
373         [EditorBrowsable(EditorBrowsableState.Never)]
374         public static readonly BindableProperty FlexMarginProperty = BindableProperty.Create(nameof(FlexMargin), typeof(Vector4), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
375         {
376             var view = (View)bindable;
377             if (newValue != null)
378             {
379                 Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FlexMargin, new Tizen.NUI.PropertyValue((Vector4)newValue));
380             }
381         },
382         defaultValueCreator: (bindable) =>
383         {
384             var view = (View)bindable;
385             Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
386             Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.FlexMargin).Get(temp);
387             return temp;
388         });
389
390         /// <summary>
391         /// CellIndexProperty
392         /// </summary>
393         [EditorBrowsable(EditorBrowsableState.Never)]
394         public static readonly BindableProperty CellIndexProperty = BindableProperty.Create(nameof(CellIndex), typeof(Vector2), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
395         {
396             var view = (View)bindable;
397             if (newValue != null)
398             {
399                 Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CellIndex, new Tizen.NUI.PropertyValue((Vector2)newValue));
400             }
401         },
402         defaultValueCreator: (bindable) =>
403         {
404             var view = (View)bindable;
405             Vector2 temp = new Vector2(0.0f, 0.0f);
406             Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CellIndex).Get(temp);
407             return temp;
408         });
409
410         /// <summary>
411         /// RowSpanProperty
412         /// </summary>
413         [EditorBrowsable(EditorBrowsableState.Never)]
414         public static readonly BindableProperty RowSpanProperty = BindableProperty.Create(nameof(RowSpan), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
415         {
416             var view = (View)bindable;
417             if (newValue != null)
418             {
419                 Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.RowSpan, new Tizen.NUI.PropertyValue((float)newValue));
420             }
421         },
422         defaultValueCreator: (bindable) =>
423         {
424             var view = (View)bindable;
425             float temp = 0.0f;
426             Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.RowSpan).Get(out temp);
427             return temp;
428         });
429
430         /// <summary>
431         /// ColumnSpanProperty
432         /// </summary>
433         [EditorBrowsable(EditorBrowsableState.Never)]
434         public static readonly BindableProperty ColumnSpanProperty = BindableProperty.Create(nameof(ColumnSpan), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
435         {
436             var view = (View)bindable;
437             if (newValue != null)
438             {
439                 Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.ColumnSpan, new Tizen.NUI.PropertyValue((float)newValue));
440             }
441         },
442         defaultValueCreator: (bindable) =>
443         {
444             var view = (View)bindable;
445             float temp = 0.0f;
446             Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.ColumnSpan).Get(out temp);
447             return temp;
448         });
449
450         /// <summary>
451         /// CellHorizontalAlignmentProperty
452         /// </summary>
453         [EditorBrowsable(EditorBrowsableState.Never)]
454         public static readonly BindableProperty CellHorizontalAlignmentProperty = BindableProperty.Create(nameof(CellHorizontalAlignment), typeof(HorizontalAlignmentType), typeof(View), HorizontalAlignmentType.Left, propertyChanged: (bindable, oldValue, newValue) =>
455         {
456             var view = (View)bindable;
457             string valueToString = "";
458
459             if (newValue != null)
460             {
461                 valueToString = ((HorizontalAlignmentType)newValue).GetDescription<HorizontalAlignmentType>();
462                 Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CellHorizontalAlignment, new Tizen.NUI.PropertyValue(valueToString));
463             }
464         },
465         defaultValueCreator: (bindable) =>
466         {
467             var view = (View)bindable;
468             string temp;
469             if (Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CellHorizontalAlignment).Get(out temp) == false)
470             {
471                 NUILog.Error("CellHorizontalAlignment get error!");
472             }
473
474             return temp.GetValueByDescription<HorizontalAlignmentType>();
475         });
476
477         /// <summary>
478         /// CellVerticalAlignmentProperty
479         /// </summary>
480         [EditorBrowsable(EditorBrowsableState.Never)]
481         public static readonly BindableProperty CellVerticalAlignmentProperty = BindableProperty.Create(nameof(CellVerticalAlignment), typeof(VerticalAlignmentType), typeof(View), VerticalAlignmentType.Top, propertyChanged: (bindable, oldValue, newValue) =>
482         {
483             var view = (View)bindable;
484             string valueToString = "";
485
486             if (newValue != null)
487             {
488                 valueToString = ((VerticalAlignmentType)newValue).GetDescription<VerticalAlignmentType>();
489                 Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CellVerticalAlignment, new Tizen.NUI.PropertyValue(valueToString));
490             }
491         },
492         defaultValueCreator: (bindable) =>
493         {
494             var view = (View)bindable;
495             string temp;
496             Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CellVerticalAlignment).Get(out temp);
497             {
498                 NUILog.Error("CellVerticalAlignment get error!");
499             }
500
501             return temp.GetValueByDescription<VerticalAlignmentType>();
502         });
503
504         /// <summary>
505         /// "Please DO NOT use! This will be deprecated! Please use 'View Weight' instead of BindableProperty"
506         /// This needs to be hidden as inhouse API until all applications using it have been updated.  Do not make public.
507         /// </summary>
508         [EditorBrowsable(EditorBrowsableState.Never)]
509         public static readonly BindableProperty WeightProperty = BindableProperty.Create(nameof(Weight), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
510         {
511             var view = (View)bindable;
512             if (newValue != null)
513             {
514                 view.Weight = (float)newValue;
515             }
516         },
517
518         defaultValueCreator: (bindable) =>
519         {
520             var view = (View)bindable;
521             return view.Weight;
522         });
523
524         /// <summary>
525         /// LeftFocusableViewProperty
526         /// </summary>
527         [EditorBrowsable(EditorBrowsableState.Never)]
528         public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create(nameof(View.LeftFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
529         {
530             var view = (View)bindable;
531             if (newValue != null) { view.LeftFocusableViewId = (int)(newValue as View)?.GetId(); }
532             else { view.LeftFocusableViewId = -1; }
533         },
534         defaultValueCreator: (bindable) =>
535         {
536             var view = (View)bindable;
537             if (view.LeftFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.LeftFocusableViewId); }
538             return null;
539         });
540
541         /// <summary>
542         /// RightFocusableViewProperty
543         /// </summary>
544         [EditorBrowsable(EditorBrowsableState.Never)]
545         public static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create(nameof(View.RightFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
546         {
547             var view = (View)bindable;
548             if (newValue != null) { view.RightFocusableViewId = (int)(newValue as View)?.GetId(); }
549             else { view.RightFocusableViewId = -1; }
550         },
551         defaultValueCreator: (bindable) =>
552         {
553             var view = (View)bindable;
554             if (view.RightFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.RightFocusableViewId); }
555             return null;
556         });
557
558         /// <summary>
559         /// UpFocusableViewProperty
560         /// </summary>
561         [EditorBrowsable(EditorBrowsableState.Never)]
562         public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create(nameof(View.UpFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
563         {
564             var view = (View)bindable;
565             if (newValue != null) { view.UpFocusableViewId = (int)(newValue as View)?.GetId(); }
566             else { view.UpFocusableViewId = -1; }
567         },
568         defaultValueCreator: (bindable) =>
569         {
570             var view = (View)bindable;
571             if (view.UpFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.UpFocusableViewId); }
572             return null;
573         });
574
575         /// <summary>
576         /// DownFocusableViewProperty
577         /// </summary>
578         [EditorBrowsable(EditorBrowsableState.Never)]
579         public static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create(nameof(View.DownFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
580         {
581             var view = (View)bindable;
582             if (newValue != null) { view.DownFocusableViewId = (int)(newValue as View)?.GetId(); }
583             else { view.DownFocusableViewId = -1; }
584         },
585         defaultValueCreator: (bindable) =>
586         {
587             var view = (View)bindable;
588             if (view.DownFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.DownFocusableViewId); }
589             return null;
590         });
591
592         /// <summary>
593         /// FocusableProperty
594         /// </summary>
595         [EditorBrowsable(EditorBrowsableState.Never)]
596         public static readonly BindableProperty FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
597         {
598             var view = (View)bindable;
599             if (newValue != null) { view.SetKeyboardFocusable((bool)newValue); }
600         },
601         defaultValueCreator: (bindable) =>
602         {
603             var view = (View)bindable;
604             return view.IsKeyboardFocusable();
605         });
606
607         /// <summary>
608         /// Size2DProperty
609         /// </summary>
610         [EditorBrowsable(EditorBrowsableState.Never)]
611         public static readonly BindableProperty Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
612         {
613             var view = (View)bindable;
614             if (newValue != null)
615             {
616                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue(new Size((Size2D)newValue)));
617             }
618         },
619         defaultValueCreator: (bindable) =>
620         {
621             var view = (View)bindable;
622             Size temp = new Size(0.0f, 0.0f, 0.0f);
623             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE).Get(temp);
624             Size2D size = new Size2D((int)temp.Width, (int)temp.Height);
625             return size;
626         });
627
628         /// <summary>
629         /// OpacityProperty
630         /// </summary>
631         [EditorBrowsable(EditorBrowsableState.Never)]
632         public static readonly BindableProperty OpacityProperty = BindableProperty.Create(nameof(Opacity), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
633         {
634             var view = (View)bindable;
635
636             if (newValue != null)
637             {
638                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.OPACITY, new Tizen.NUI.PropertyValue((float)newValue));
639             }
640         },
641         defaultValueCreator: (bindable) =>
642         {
643             var view = (View)bindable;
644             float temp = 0.0f;
645             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.OPACITY).Get(out temp);
646             return temp;
647         });
648
649         /// <summary>
650         /// Position2DProperty
651         /// </summary>
652         [EditorBrowsable(EditorBrowsableState.Never)]
653         public static readonly BindableProperty Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
654         {
655             var view = (View)bindable;
656             if (newValue != null)
657             {
658                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue(new Position((Position2D)newValue)));
659             }
660         },
661         defaultValueCreator: (bindable) =>
662         {
663             var view = (View)bindable;
664             Position temp = new Position(0.0f, 0.0f, 0.0f);
665             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION).Get(temp);
666             return new Position2D(temp);
667         });
668
669         /// <summary>
670         /// PositionUsesPivotPointProperty
671         /// </summary>
672         [EditorBrowsable(EditorBrowsableState.Never)]
673         public static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool), typeof(View), true, propertyChanged: (bindable, oldValue, newValue) =>
674         {
675             var view = (View)bindable;
676             if (newValue != null)
677             {
678                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PositionUsesAnchorPoint, new Tizen.NUI.PropertyValue((bool)newValue));
679             }
680         },
681         defaultValueCreator: (bindable) =>
682         {
683             var view = (View)bindable;
684             bool temp = false;
685             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PositionUsesAnchorPoint).Get(out temp);
686             return temp;
687         });
688
689         /// <summary>
690         /// SiblingOrderProperty
691         /// </summary>
692         [EditorBrowsable(EditorBrowsableState.Never)]
693         public static readonly BindableProperty SiblingOrderProperty = BindableProperty.Create(nameof(SiblingOrder), typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) =>
694         {
695             var view = (View)bindable;
696             int value;
697             if (newValue != null)
698             {
699                 value = (int)newValue;
700                 if (value < 0)
701                 {
702                     NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0.");
703                     return;
704                 }
705                 var siblings = view.GetParent()?.Children;
706                 if (siblings != null)
707                 {
708                     int currentOrder = siblings.IndexOf(view);
709                     if (value != currentOrder)
710                     {
711                         if (value == 0) { view.LowerToBottom(); }
712                         else if (value < siblings.Count - 1)
713                         {
714                             if (value > currentOrder) { view.RaiseAbove(siblings[value]); }
715                             else { view.LowerBelow(siblings[value]); }
716                         }
717                         else { view.RaiseToTop(); }
718                     }
719                 }
720             }
721         },
722         defaultValueCreator: (bindable) =>
723         {
724             var view = (View)bindable;
725             var parentChildren = view.GetParent()?.Children;
726             int currentOrder = 0;
727             if (parentChildren != null)
728             {
729                 currentOrder = parentChildren.IndexOf(view);
730
731                 if (currentOrder < 0) { return 0; }
732                 else if (currentOrder < parentChildren.Count) { return currentOrder; }
733             }
734
735             return 0;
736         });
737
738         /// <summary>
739         /// ParentOriginProperty
740         /// </summary>
741         [EditorBrowsable(EditorBrowsableState.Never)]
742         public static readonly BindableProperty ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
743         {
744             var view = (View)bindable;
745             if (newValue != null)
746             {
747                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ParentOrigin, new Tizen.NUI.PropertyValue((Position)newValue));
748             }
749         },
750         defaultValueCreator: (bindable) =>
751         {
752             var view = (View)bindable;
753             Position temp = new Position(0.0f, 0.0f, 0.0f);
754             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ParentOrigin).Get(temp);
755             return temp;
756         }
757         );
758
759         /// <summary>
760         /// PivotPointProperty
761         /// </summary>
762         [EditorBrowsable(EditorBrowsableState.Never)]
763         public static readonly BindableProperty PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
764         {
765             var view = (View)bindable;
766             if (newValue != null)
767             {
768                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.AnchorPoint, new Tizen.NUI.PropertyValue((Position)newValue));
769             }
770         },
771         defaultValueCreator: (bindable) =>
772         {
773             var view = (View)bindable;
774             Position temp = new Position(0.0f, 0.0f, 0.0f);
775             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.AnchorPoint).Get(temp);
776             return temp;
777         });
778
779         /// <summary>
780         /// SizeWidthProperty
781         /// </summary>
782         [EditorBrowsable(EditorBrowsableState.Never)]
783         public static readonly BindableProperty SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
784         {
785             var view = (View)bindable;
786             if (newValue != null)
787             {
788                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SizeWidth, new Tizen.NUI.PropertyValue((float)newValue));
789                 view.WidthSpecification = (int)System.Math.Ceiling((float)newValue);
790             }
791         },
792         defaultValueCreator: (bindable) =>
793         {
794             var view = (View)bindable;
795             float temp = 0.0f;
796             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SizeWidth).Get(out temp);
797             return temp;
798         });
799
800         /// <summary>
801         /// SizeHeightProperty
802         /// </summary>
803         [EditorBrowsable(EditorBrowsableState.Never)]
804         public static readonly BindableProperty SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
805         {
806             var view = (View)bindable;
807             if (newValue != null)
808             {
809                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SizeHeight, new Tizen.NUI.PropertyValue((float)newValue));
810                 view.HeightSpecification = (int)System.Math.Ceiling((float)newValue);
811             }
812         },
813         defaultValueCreator: (bindable) =>
814         {
815             var view = (View)bindable;
816             float temp = 0.0f;
817             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SizeHeight).Get(out temp);
818             return temp;
819         });
820
821         /// <summary>
822         /// PositionProperty
823         /// </summary>
824         [EditorBrowsable(EditorBrowsableState.Never)]
825         public static readonly BindableProperty PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
826         {
827             var view = (View)bindable;
828             if (newValue != null)
829             {
830                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue((Position)newValue));
831             }
832         },
833         defaultValueCreator: (bindable) =>
834         {
835             var view = (View)bindable;
836             Position temp = new Position(0.0f, 0.0f, 0.0f);
837             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION).Get(temp);
838             return temp;
839         });
840
841         /// <summary>
842         /// PositionXProperty
843         /// </summary>
844         [EditorBrowsable(EditorBrowsableState.Never)]
845         public static readonly BindableProperty PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
846         {
847             var view = (View)bindable;
848             if (newValue != null)
849             {
850                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PositionX, new Tizen.NUI.PropertyValue((float)newValue));
851             }
852         },
853         defaultValueCreator: (bindable) =>
854         {
855             var view = (View)bindable;
856             float temp = 0.0f;
857             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PositionX).Get(out temp);
858             return temp;
859         });
860
861         /// <summary>
862         /// PositionYProperty
863         /// </summary>
864         [EditorBrowsable(EditorBrowsableState.Never)]
865         public static readonly BindableProperty PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
866         {
867             var view = (View)bindable;
868             if (newValue != null)
869             {
870                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PositionY, new Tizen.NUI.PropertyValue((float)newValue));
871             }
872         },
873         defaultValueCreator: (bindable) =>
874         {
875             var view = (View)bindable;
876             float temp = 0.0f;
877             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PositionY).Get(out temp);
878             return temp;
879         });
880
881         /// <summary>
882         /// PositionZProperty
883         /// </summary>
884         [EditorBrowsable(EditorBrowsableState.Never)]
885         public static readonly BindableProperty PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
886         {
887             var view = (View)bindable;
888             if (newValue != null)
889             {
890                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PositionZ, new Tizen.NUI.PropertyValue((float)newValue));
891             }
892         },
893         defaultValueCreator: (bindable) =>
894         {
895             var view = (View)bindable;
896             float temp = 0.0f;
897             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PositionZ).Get(out temp);
898             return temp;
899         });
900
901         /// <summary>
902         /// OrientationProperty
903         /// </summary>
904         [EditorBrowsable(EditorBrowsableState.Never)]
905         public static readonly BindableProperty OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
906         {
907             var view = (View)bindable;
908             if (newValue != null)
909             {
910                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue));
911             }
912         },
913         defaultValueCreator: (bindable) =>
914         {
915             var view = (View)bindable;
916             Rotation temp = new Rotation();
917             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ORIENTATION).Get(temp);
918             return temp;
919         });
920
921         /// <summary>
922         /// ScaleProperty
923         /// </summary>
924         [EditorBrowsable(EditorBrowsableState.Never)]
925         public static readonly BindableProperty ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
926         {
927             var view = (View)bindable;
928             if (newValue != null)
929             {
930                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE, new Tizen.NUI.PropertyValue((Vector3)newValue));
931             }
932         },
933         defaultValueCreator: (bindable) =>
934         {
935             var view = (View)bindable;
936             Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
937             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE).Get(temp);
938             return temp;
939         });
940
941         /// <summary>
942         /// ScaleXProperty
943         /// </summary>
944         [EditorBrowsable(EditorBrowsableState.Never)]
945         public static readonly BindableProperty ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
946         {
947             var view = (View)bindable;
948             if (newValue != null)
949             {
950                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ScaleX, new Tizen.NUI.PropertyValue((float)newValue));
951             }
952         },
953         defaultValueCreator: (bindable) =>
954         {
955             var view = (View)bindable;
956             float temp = 0.0f;
957             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ScaleX).Get(out temp);
958             return temp;
959         });
960
961         /// <summary>
962         /// ScaleYProperty
963         /// </summary>
964         [EditorBrowsable(EditorBrowsableState.Never)]
965         public static readonly BindableProperty ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
966         {
967             var view = (View)bindable;
968             if (newValue != null)
969             {
970                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ScaleY, new Tizen.NUI.PropertyValue((float)newValue));
971             }
972         },
973         defaultValueCreator: (bindable) =>
974         {
975             var view = (View)bindable;
976             float temp = 0.0f;
977             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ScaleY).Get(out temp);
978             return temp;
979         });
980
981         /// <summary>
982         /// ScaleZProperty
983         /// </summary>
984         [EditorBrowsable(EditorBrowsableState.Never)]
985         public static readonly BindableProperty ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
986         {
987             var view = (View)bindable;
988             if (newValue != null)
989             {
990                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ScaleZ, new Tizen.NUI.PropertyValue((float)newValue));
991             }
992         },
993         defaultValueCreator: (bindable) =>
994         {
995             var view = (View)bindable;
996             float temp = 0.0f;
997             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ScaleZ).Get(out temp);
998             return temp;
999         });
1000
1001         /// <summary>
1002         /// NameProperty
1003         /// </summary>
1004         [EditorBrowsable(EditorBrowsableState.Never)]
1005         public static readonly BindableProperty NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
1006         {
1007             var view = (View)bindable;
1008             if (newValue != null)
1009             {
1010                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.NAME, new Tizen.NUI.PropertyValue((string)newValue));
1011             }
1012         },
1013         defaultValueCreator: (bindable) =>
1014         {
1015             var view = (View)bindable;
1016             string temp;
1017             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.NAME).Get(out temp);
1018             return temp;
1019         });
1020
1021         /// <summary>
1022         /// SensitiveProperty
1023         /// </summary>
1024         [EditorBrowsable(EditorBrowsableState.Never)]
1025         public static readonly BindableProperty SensitiveProperty = BindableProperty.Create(nameof(Sensitive), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1026         {
1027             var view = (View)bindable;
1028             if (newValue != null)
1029             {
1030                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SENSITIVE, new Tizen.NUI.PropertyValue((bool)newValue));
1031             }
1032         },
1033         defaultValueCreator: (bindable) =>
1034         {
1035             var view = (View)bindable;
1036             bool temp = false;
1037             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SENSITIVE).Get(out temp);
1038             return temp;
1039         });
1040
1041         /// <summary>
1042         /// LeaveRequiredProperty
1043         /// </summary>
1044         [EditorBrowsable(EditorBrowsableState.Never)]
1045         public static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create(nameof(LeaveRequired), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1046         {
1047             var view = (View)bindable;
1048             if (newValue != null)
1049             {
1050                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LeaveRequired, new Tizen.NUI.PropertyValue((bool)newValue));
1051             }
1052         },
1053         defaultValueCreator: (bindable) =>
1054         {
1055             var view = (View)bindable;
1056             bool temp = false;
1057             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.LeaveRequired).Get(out temp);
1058             return temp;
1059         });
1060
1061         /// <summary>
1062         /// InheritOrientationProperty
1063         /// </summary>
1064         [EditorBrowsable(EditorBrowsableState.Never)]
1065         public static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create(nameof(InheritOrientation), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1066         {
1067             var view = (View)bindable;
1068             if (newValue != null)
1069             {
1070                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.InheritOrientation, new Tizen.NUI.PropertyValue((bool)newValue));
1071             }
1072         },
1073         defaultValueCreator: (bindable) =>
1074         {
1075             var view = (View)bindable;
1076             bool temp = false;
1077             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.InheritOrientation).Get(out temp);
1078             return temp;
1079         });
1080
1081         /// <summary>
1082         /// InheritScaleProperty
1083         /// </summary>
1084         [EditorBrowsable(EditorBrowsableState.Never)]
1085         public static readonly BindableProperty InheritScaleProperty = BindableProperty.Create(nameof(InheritScale), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1086         {
1087             var view = (View)bindable;
1088             if (newValue != null)
1089             {
1090                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.InheritScale, new Tizen.NUI.PropertyValue((bool)newValue));
1091             }
1092         },
1093         defaultValueCreator: (bindable) =>
1094         {
1095             var view = (View)bindable;
1096             bool temp = false;
1097             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.InheritScale).Get(out temp);
1098             return temp;
1099         });
1100
1101         /// <summary>
1102         /// DrawModeProperty
1103         /// </summary>
1104         [EditorBrowsable(EditorBrowsableState.Never)]
1105         public static readonly BindableProperty DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType), typeof(View), DrawModeType.Normal, propertyChanged: (bindable, oldValue, newValue) =>
1106         {
1107             var view = (View)bindable;
1108             if (newValue != null)
1109             {
1110                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.DrawMode, new Tizen.NUI.PropertyValue((int)newValue));
1111             }
1112         },
1113         defaultValueCreator: (bindable) =>
1114         {
1115             var view = (View)bindable;
1116             int temp;
1117             if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.DrawMode).Get(out temp) == false)
1118             {
1119                 NUILog.Error("DrawMode get error!");
1120             }
1121             return (DrawModeType)temp;
1122         });
1123
1124         /// <summary>
1125         /// SizeModeFactorProperty
1126         /// </summary>
1127         [EditorBrowsable(EditorBrowsableState.Never)]
1128         public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1129         {
1130             var view = (View)bindable;
1131             if (newValue != null)
1132             {
1133                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SizeModeFactor, new Tizen.NUI.PropertyValue((Vector3)newValue));
1134             }
1135         },
1136         defaultValueCreator: (bindable) =>
1137         {
1138             var view = (View)bindable;
1139             Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1140             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SizeModeFactor).Get(temp);
1141             return temp;
1142         });
1143
1144         /// <summary>
1145         /// WidthResizePolicyProperty
1146         /// </summary>
1147         [EditorBrowsable(EditorBrowsableState.Never)]
1148         public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (bindable, oldValue, newValue) =>
1149         {
1150             var view = (View)bindable;
1151             if (newValue != null)
1152             {
1153                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WidthResizePolicy, new Tizen.NUI.PropertyValue((int)newValue));
1154                 // Match ResizePolicy to new Layouting.
1155                 // Parent relative policies can not be mapped at this point as parent size unknown.
1156                 switch ((ResizePolicyType)newValue)
1157                 {
1158                     case ResizePolicyType.UseNaturalSize:
1159                         {
1160                             view.WidthSpecification = LayoutParamPolicies.WrapContent;
1161                             break;
1162                         }
1163                     case ResizePolicyType.FillToParent:
1164                         {
1165                             view.WidthSpecification = LayoutParamPolicies.MatchParent;
1166                             break;
1167                         }
1168                     case ResizePolicyType.FitToChildren:
1169                         {
1170                             view.WidthSpecification = LayoutParamPolicies.WrapContent;
1171                             break;
1172                         }
1173                     default:
1174                         break;
1175                 }
1176             }
1177         },
1178         defaultValueCreator: (bindable) =>
1179         {
1180             var view = (View)bindable;
1181             string temp;
1182             if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.WidthResizePolicy).Get(out temp) == false)
1183             {
1184                 NUILog.Error("WidthResizePolicy get error!");
1185             }
1186             return temp.GetValueByDescription<ResizePolicyType>();
1187         });
1188
1189         /// <summary>
1190         /// HeightResizePolicyProperty
1191         /// </summary>
1192         [EditorBrowsable(EditorBrowsableState.Never)]
1193         public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (bindable, oldValue, newValue) =>
1194         {
1195             var view = (View)bindable;
1196             if (newValue != null)
1197             {
1198                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HeightResizePolicy, new Tizen.NUI.PropertyValue((int)newValue));
1199                 // Match ResizePolicy to new Layouting.
1200                 // Parent relative policies can not be mapped at this point as parent size unknown.
1201                 switch ((ResizePolicyType)newValue)
1202                 {
1203                     case ResizePolicyType.UseNaturalSize:
1204                         {
1205                             view.HeightSpecification = LayoutParamPolicies.WrapContent;
1206                             break;
1207                         }
1208                     case ResizePolicyType.FillToParent:
1209                         {
1210                             view.HeightSpecification = LayoutParamPolicies.MatchParent;
1211                             break;
1212                         }
1213                     case ResizePolicyType.FitToChildren:
1214                         {
1215                             view.HeightSpecification = LayoutParamPolicies.WrapContent;
1216                             break;
1217                         }
1218                     default:
1219                         break;
1220                 }
1221             }
1222         },
1223         defaultValueCreator: (bindable) =>
1224         {
1225             var view = (View)bindable;
1226             string temp;
1227             if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.HeightResizePolicy).Get(out temp) == false)
1228             {
1229                 NUILog.Error("HeightResizePolicy get error!");
1230             }
1231             return temp.GetValueByDescription<ResizePolicyType>();
1232         });
1233
1234         /// <summary>
1235         /// SizeScalePolicyProperty
1236         /// </summary>
1237         [EditorBrowsable(EditorBrowsableState.Never)]
1238         public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create(nameof(SizeScalePolicy), typeof(SizeScalePolicyType), typeof(View), SizeScalePolicyType.UseSizeSet, propertyChanged: (bindable, oldValue, newValue) =>
1239         {
1240             var view = (View)bindable;
1241             string valueToString = "";
1242             if (newValue != null)
1243             {
1244                 valueToString = ((SizeScalePolicyType)newValue).GetDescription<SizeScalePolicyType>();
1245                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SizeScalePolicy, new Tizen.NUI.PropertyValue(valueToString));
1246             }
1247         },
1248         defaultValueCreator: (bindable) =>
1249         {
1250             var view = (View)bindable;
1251             int temp;
1252             if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SizeScalePolicy).Get(out temp) == false)
1253             {
1254                 NUILog.Error("SizeScalePolicy get error!");
1255             }
1256             return (SizeScalePolicyType)temp;
1257         });
1258
1259         /// <summary>
1260         /// WidthForHeightProperty
1261         /// </summary>
1262         [EditorBrowsable(EditorBrowsableState.Never)]
1263         public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1264         {
1265             var view = (View)bindable;
1266             if (newValue != null)
1267             {
1268                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WidthForHeight, new Tizen.NUI.PropertyValue((bool)newValue));
1269             }
1270         },
1271         defaultValueCreator: (bindable) =>
1272         {
1273             var view = (View)bindable;
1274             bool temp = false;
1275             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.WidthForHeight).Get(out temp);
1276             return temp;
1277         });
1278
1279         /// <summary>
1280         /// HeightForWidthProperty
1281         /// </summary>
1282         [EditorBrowsable(EditorBrowsableState.Never)]
1283         public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1284         {
1285             var view = (View)bindable;
1286             if (newValue != null)
1287             {
1288                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HeightForWidth, new Tizen.NUI.PropertyValue((bool)newValue));
1289             }
1290         },
1291         defaultValueCreator: (bindable) =>
1292         {
1293             var view = (View)bindable;
1294             bool temp = false;
1295             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.HeightForWidth).Get(out temp);
1296             return temp;
1297         });
1298
1299         /// <summary>
1300         /// PaddingProperty
1301         /// </summary>
1302         [EditorBrowsable(EditorBrowsableState.Never)]
1303         public static readonly BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1304         {
1305             var view = (View)bindable;
1306             if (newValue != null)
1307             {
1308                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PADDING, new Tizen.NUI.PropertyValue((Extents)newValue));
1309             }
1310         },
1311         defaultValueCreator: (bindable) =>
1312         {
1313             var view = (View)bindable;
1314             Extents temp = new Extents(0, 0, 0, 0);
1315             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PADDING).Get(temp);
1316             return temp;
1317         });
1318
1319         /// <summary>
1320         /// SizeProperty
1321         /// </summary>
1322         [EditorBrowsable(EditorBrowsableState.Never)]
1323         public static readonly BindableProperty SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1324         {
1325             var view = (View)bindable;
1326             if (newValue != null)
1327             {
1328                 Size size = (Size)newValue;
1329                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue(size));
1330                 // Set Specification so when layouts measure this View it matches the value set here.
1331                 // All Views are currently Layouts.
1332                 view.WidthSpecification = (int)System.Math.Ceiling(size.Width);
1333                 view.HeightSpecification = (int)System.Math.Ceiling(size.Height);
1334             }
1335         },
1336         defaultValueCreator: (bindable) =>
1337         {
1338             var view = (View)bindable;
1339             Size temp = new Size(0, 0, 0);
1340             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE).Get(temp);
1341             return temp;
1342         });
1343
1344         /// <summary>
1345         /// MinimumSizeProperty
1346         /// </summary>
1347         [EditorBrowsable(EditorBrowsableState.Never)]
1348         public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1349         {
1350             var view = (View)bindable;
1351             Size2D temp = newValue as Size2D;
1352             if (temp != null)
1353             {
1354                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MinimumSize, new Tizen.NUI.PropertyValue(temp));
1355             }
1356             else
1357             {
1358                 Tizen.Log.Fatal("NUI", $"[ERROR] can't set MinimumSizeProperty!");
1359             }
1360         },
1361         defaultValueCreator: (bindable) =>
1362         {
1363             var view = (View)bindable;
1364             Size2D temp = new Size2D(0, 0);
1365             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MinimumSize).Get(temp);
1366             return temp;
1367         });
1368
1369         /// <summary>
1370         /// MaximumSizeProperty
1371         /// </summary>
1372         [EditorBrowsable(EditorBrowsableState.Never)]
1373         public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1374         {
1375             var view = (View)bindable;
1376             Size2D temp = newValue as Size2D;
1377             if (temp != null)
1378             {
1379                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MaximumSize, new Tizen.NUI.PropertyValue(temp));
1380             }
1381             else
1382             {
1383                 Tizen.Log.Fatal("NUI", $"[ERROR] can't set MaximumSizeProperty!");
1384             }
1385         },
1386         defaultValueCreator: (bindable) =>
1387         {
1388             var view = (View)bindable;
1389             Size2D temp = new Size2D(0, 0);
1390             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MaximumSize).Get(temp);
1391             return temp;
1392         });
1393
1394         /// <summary>
1395         /// InheritPositionProperty
1396         /// </summary>
1397         [EditorBrowsable(EditorBrowsableState.Never)]
1398         public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create(nameof(InheritPosition), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1399         {
1400             var view = (View)bindable;
1401             if (newValue != null)
1402             {
1403                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.InheritPosition, new Tizen.NUI.PropertyValue((bool)newValue));
1404             }
1405         },
1406         defaultValueCreator: (bindable) =>
1407         {
1408             var view = (View)bindable;
1409             bool temp = false;
1410             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.InheritPosition).Get(out temp);
1411             return temp;
1412         });
1413
1414         /// <summary>
1415         /// ClippingModeProperty
1416         /// </summary>
1417         [EditorBrowsable(EditorBrowsableState.Never)]
1418         public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType), typeof(View), ClippingModeType.Disabled, propertyChanged: (bindable, oldValue, newValue) =>
1419         {
1420             var view = (View)bindable;
1421             if (newValue != null)
1422             {
1423                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ClippingMode, new Tizen.NUI.PropertyValue((int)newValue));
1424             }
1425         },
1426         defaultValueCreator: (bindable) =>
1427         {
1428             var view = (View)bindable;
1429             int temp = 0;
1430             if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ClippingMode).Get(out temp) == false)
1431             {
1432                 NUILog.Error("ClippingMode get error!");
1433             }
1434             return (ClippingModeType)temp;
1435         });
1436
1437         /// <summary>
1438         /// InheritLayoutDirectionProperty
1439         /// </summary>
1440         [EditorBrowsable(EditorBrowsableState.Never)]
1441         public static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create(nameof(InheritLayoutDirection), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1442         {
1443             var view = (View)bindable;
1444             if (newValue != null)
1445             {
1446                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.InheritLayoutDirection, new Tizen.NUI.PropertyValue((bool)newValue));
1447             }
1448         },
1449         defaultValueCreator: (bindable) =>
1450         {
1451             var view = (View)bindable;
1452             bool temp = false;
1453             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.InheritLayoutDirection).Get(out temp);
1454             return temp;
1455         });
1456
1457         /// <summary>
1458         /// LayoutDirectionProperty
1459         /// </summary>
1460         [EditorBrowsable(EditorBrowsableState.Never)]
1461         public static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create(nameof(LayoutDirection), typeof(ViewLayoutDirectionType), typeof(View), ViewLayoutDirectionType.LTR, propertyChanged: (bindable, oldValue, newValue) =>
1462         {
1463             var view = (View)bindable;
1464             if (newValue != null)
1465             {
1466                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LayoutDirection, new Tizen.NUI.PropertyValue((int)newValue));
1467             }
1468         },
1469         defaultValueCreator: (bindable) =>
1470         {
1471             var view = (View)bindable;
1472             int temp;
1473             if (false == Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.LayoutDirection).Get(out temp))
1474             {
1475                 NUILog.Error("LAYOUT_DIRECTION get error!");
1476             }
1477             return (ViewLayoutDirectionType)temp;
1478         });
1479
1480         /// <summary>
1481         /// MarginProperty
1482         /// </summary>
1483         [EditorBrowsable(EditorBrowsableState.Never)]
1484         public static readonly BindableProperty MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1485         {
1486             var view = (View)bindable;
1487             if (newValue != null)
1488             {
1489                 Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MARGIN, new Tizen.NUI.PropertyValue((Extents)newValue));
1490             }
1491         },
1492         defaultValueCreator: (bindable) =>
1493         {
1494             var view = (View)bindable;
1495             Extents temp = new Extents(0, 0, 0, 0);
1496             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MARGIN).Get(temp);
1497             return temp;
1498         });
1499
1500         /// <summary>
1501         /// UpdateSizeHintProperty
1502         /// </summary>
1503         [EditorBrowsable(EditorBrowsableState.Never)]
1504         public static readonly BindableProperty UpdateSizeHintProperty = BindableProperty.Create(nameof(UpdateSizeHint), typeof(Vector2), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1505         {
1506             var view = (View)bindable;
1507             if (newValue != null)
1508             {
1509                 Tizen.NUI.Object.SetProperty(view.swigCPtr, Interop.ViewProperty.UpdateSizeHintGet(), new Tizen.NUI.PropertyValue((Vector2)newValue));
1510             }
1511         },
1512         defaultValueCreator: (bindable) =>
1513         {
1514             var view = (View)bindable;
1515
1516             Vector2 temp = new Vector2(0.0f, 0.0f);
1517             Tizen.NUI.Object.GetProperty(view.swigCPtr, Interop.ViewProperty.UpdateSizeHintGet()).Get(temp);
1518             return temp;
1519         });
1520
1521         /// <summary>
1522         /// ImageShadow Property
1523         /// </summary>
1524         [EditorBrowsable(EditorBrowsableState.Never)]
1525         public static readonly BindableProperty ImageShadowProperty = BindableProperty.Create(nameof(ImageShadow), typeof(ImageShadow), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1526         {
1527             var shadow = (ImageShadow)newValue;
1528             var view = (View)bindable;
1529             Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SHADOW, shadow == null ? new PropertyValue() : shadow.ToPropertyValue(view));
1530         },
1531         defaultValueCreator: (bindable) =>
1532         {
1533             var view = (View)bindable;
1534
1535             PropertyMap map = new PropertyMap();
1536             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SHADOW).Get(map);
1537
1538             var shadow = new ImageShadow(map);
1539             return shadow.IsEmpty() ? null : shadow;
1540         });
1541
1542         /// <summary>
1543         /// Shadow Property
1544         /// </summary>
1545         [EditorBrowsable(EditorBrowsableState.Never)]
1546         public static readonly BindableProperty BoxShadowProperty = BindableProperty.Create(nameof(BoxShadow), typeof(Shadow), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1547         {
1548             var shadow = (Shadow)newValue;
1549             var view = (View)bindable;
1550             Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SHADOW, shadow == null ? new PropertyValue() : shadow.ToPropertyValue(view));
1551         },
1552         defaultValueCreator: (bindable) =>
1553         {
1554             var view = (View)bindable;
1555
1556             PropertyMap map = new PropertyMap();
1557             Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SHADOW).Get(map);
1558
1559             var shadow = new Shadow(map);
1560             return shadow.IsEmpty() ? null : shadow;
1561         });
1562
1563         /// <summary>
1564         /// CornerRadius Property
1565         /// </summary>
1566         [EditorBrowsable(EditorBrowsableState.Never)]
1567         public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
1568         {
1569             var view = (View)bindable;
1570             (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).CornerRadius = (float)newValue;
1571             view.ApplyCornerRadius();
1572         },
1573         defaultValueCreator: (bindable) =>
1574         {
1575             var view = (View)bindable;
1576             return view.backgroundExtraData == null ? 0 : view.backgroundExtraData.CornerRadius;
1577         });
1578
1579         /// <summary>
1580         /// CornerRadiusPolicy Property
1581         /// </summary>
1582         [EditorBrowsable(EditorBrowsableState.Never)]
1583         public static readonly BindableProperty CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType), typeof(View), VisualTransformPolicyType.Absolute, propertyChanged: (bindable, oldValue, newValue) =>
1584         {
1585             var view = (View)bindable;
1586             (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).CornerRadiusPolicy = (VisualTransformPolicyType)newValue;
1587             if (view.backgroundExtraData.CornerRadius != 0)
1588             {
1589                 view.ApplyCornerRadius();
1590             }
1591         },
1592         defaultValueCreator: (bindable) =>
1593         {
1594             var view = (View)bindable;
1595             return view.backgroundExtraData == null ? VisualTransformPolicyType.Absolute : view.backgroundExtraData.CornerRadiusPolicy;
1596         });
1597
1598         /// <summary>
1599         /// EnableControlState property
1600         /// </summary>
1601         [EditorBrowsable(EditorBrowsableState.Never)]
1602         public static readonly BindableProperty EnableControlStateProperty = BindableProperty.Create(nameof(EnableControlState), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1603         {
1604             var view = (View)bindable;
1605             bool prev = view.enableControlState;
1606             view.enableControlState = (bool)newValue;
1607
1608             if (prev != view.enableControlState)
1609             {
1610                 if (prev)
1611                 {
1612                     view.TouchEvent -= view.EmptyOnTouch;
1613                 }
1614                 else
1615                 {
1616                     view.TouchEvent += view.EmptyOnTouch;
1617                 }
1618             }
1619         },
1620         defaultValueCreator: (bindable) =>
1621         {
1622             return ((View)bindable).enableControlState;
1623         });
1624
1625         /// <summary>
1626         /// ThemeChangeSensitive property
1627         /// </summary>
1628         [EditorBrowsable(EditorBrowsableState.Never)]
1629         public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
1630         {
1631             var view = (View)bindable;
1632
1633             if (view.themeChangeSensitive == (bool)newValue) return;
1634
1635             view.themeChangeSensitive = (bool)newValue;
1636
1637             if (view.themeChangeSensitive)
1638             {
1639                 ThemeManager.ThemeChangedInternal.Add(view.OnThemeChanged);
1640             }
1641             else
1642             {
1643                 ThemeManager.ThemeChangedInternal.Remove(view.OnThemeChanged);
1644             }
1645         },
1646         defaultValueCreator: (bindable) =>
1647         {
1648             return ((View)bindable).themeChangeSensitive;
1649         });
1650
1651         #region Selectors
1652         internal static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1653         {
1654             var view = (View)bindable;
1655             view.SelectorData.BackgroundImage.Update(view, (Selector<string>)newValue, true);
1656             if (newValue != null) view.SelectorData.BackgroundColor.Reset(view);
1657         },
1658         defaultValueCreator: (bindable) =>
1659         {
1660             var view = (View)bindable;
1661             return view.SelectorData.BackgroundImage.Get(view);
1662         });
1663
1664         internal static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1665         {
1666             var view = (View)bindable;
1667             view.SelectorData.BackgroundColor.Update(view, (Selector<Color>)newValue, true);
1668             if (newValue != null) view.SelectorData.BackgroundImage.Reset(view);
1669         },
1670         defaultValueCreator: (bindable) =>
1671         {
1672             var view = (View)bindable;
1673             return view.SelectorData.BackgroundColor.Get(view);
1674         });
1675
1676         internal static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1677         {
1678             var view = (View)bindable;
1679             view.SelectorData.BackgroundImageBorder.Update(view, (Selector<Rectangle>)newValue, true);
1680         },
1681         defaultValueCreator: (bindable) =>
1682         {
1683             var view = (View)bindable;
1684             return view.SelectorData.BackgroundImageBorder.Get(view);
1685         });
1686
1687         internal static readonly BindableProperty ColorSelectorProperty = BindableProperty.Create("ColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1688         {
1689             var view = (View)bindable;
1690             view.SelectorData.Color.Update(view, (Selector<Color>)newValue, true);
1691         },
1692         defaultValueCreator: (bindable) =>
1693         {
1694             var view = (View)bindable;
1695             return view.SelectorData.Color.Get(view);
1696         });
1697
1698         internal static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1699         {
1700             var view = (View)bindable;
1701             view.SelectorData.Opacity.Update(view, (Selector<float?>)newValue, true);
1702         },
1703         defaultValueCreator: (bindable) =>
1704         {
1705             var view = (View)bindable;
1706             return view.SelectorData.Opacity.Get(view);
1707         });
1708
1709         /// <summary>
1710         /// ImageShadow Selector Property for binding to ViewStyle
1711         /// </summary>
1712         [EditorBrowsable(EditorBrowsableState.Never)]
1713         public static readonly BindableProperty ImageShadowSelectorProperty = BindableProperty.Create("ImageShadowSelector", typeof(Selector<ImageShadow>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1714         {
1715             var view = (View)bindable;
1716             view.SelectorData.ImageShadow.Update(view, (Selector<ImageShadow>)newValue, true);
1717             if (newValue != null) view.SelectorData.BoxShadow.Reset(view);
1718         },
1719         defaultValueCreator: (bindable) =>
1720         {
1721             var view = (View)bindable;
1722             return view.SelectorData.ImageShadow.Get(view);
1723         });
1724
1725         /// <summary>
1726         /// BoxShadow Selector Property for binding to ViewStyle
1727         /// </summary>
1728         [EditorBrowsable(EditorBrowsableState.Never)]
1729         public static readonly BindableProperty BoxShadowSelectorProperty = BindableProperty.Create("BoxShadowSelector", typeof(Selector<Shadow>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1730         {
1731             var view = (View)bindable;
1732             view.SelectorData.BoxShadow.Update(view, (Selector<Shadow>)newValue, true);
1733             if (newValue != null) view.SelectorData.ImageShadow.Reset(view);
1734         },
1735         defaultValueCreator: (bindable) =>
1736         {
1737             var view = (View)bindable;
1738             return view.SelectorData.BoxShadow.Get(view);
1739         });
1740
1741         /// <summary>
1742         /// CornerRadius Selector Property
1743         /// </summary>
1744         [EditorBrowsable(EditorBrowsableState.Never)]
1745         public static readonly BindableProperty CornerRadiusSelectorProperty = BindableProperty.Create("CornerRadiusSelector", typeof(Selector<float?>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
1746         {
1747             var view = (View)bindable;
1748             view.SelectorData.CornerRadius.Update(view, (Selector<float?>)newValue, true);
1749         },
1750         defaultValueCreator: (bindable) =>
1751         {
1752             var view = (View)bindable;
1753             return view.SelectorData.CornerRadius.Get(view);
1754         });
1755         #endregion
1756     }
1757 }