41aa0a428cb065f1812901577d00be3750592807
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewBindableProperty.cs
1 /*
2  * Copyright(c) 2019-2022 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 global::System;
19 using System.ComponentModel;
20 using Tizen.NUI.Binding;
21
22 namespace Tizen.NUI.BaseComponents
23 {
24     /// <summary>
25     /// View is the base class for all views.
26     /// </summary>
27     /// <since_tizen> 3 </since_tizen>
28     public partial class View
29     {
30         private float userSizeWidth = 0.0f;
31         private float userSizeHeight = 0.0f;
32
33         /// <summary>
34         /// StyleNameProperty (DALi json)
35         /// </summary>
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         public static readonly BindableProperty StyleNameProperty = BindableProperty.Create(nameof(StyleName), typeof(string), typeof(View), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
38         {
39             var view = (View)bindable;
40             if (newValue != null)
41             {
42                 string styleName = (string)newValue;
43
44                 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.StyleName, styleName);
45
46                 view.styleName = styleName;
47
48                 if (string.IsNullOrEmpty(styleName)) return;
49
50                 var style = ThemeManager.GetUpdateStyleWithoutClone(styleName);
51
52                 if (style == null) return;
53
54                 view.ApplyStyle(style);
55                 view.SetThemeApplied();
56             }
57         }),
58         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
59         {
60             var view = (View)bindable;
61
62             if (!string.IsNullOrEmpty(view.styleName)) return view.styleName;
63
64             return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.StyleName);
65         }));
66
67         /// <summary>
68         /// KeyInputFocusProperty
69         /// </summary>
70         [EditorBrowsable(EditorBrowsableState.Never)]
71         public static readonly BindableProperty KeyInputFocusProperty = BindableProperty.Create(nameof(KeyInputFocus), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
72         {
73             var view = (View)bindable;
74             if (newValue != null)
75             {
76                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.KeyInputFocus, (bool)newValue);
77             }
78         }),
79         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
80         {
81             var view = (View)bindable;
82             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.KeyInputFocus);
83         }));
84
85         // BackgroundColorProperty
86         internal static void SetInternalBackgroundColorProperty(BindableObject bindable, object oldValue, object newValue)
87         {
88             var view = (View)bindable;
89
90             if (NUIApplication.IsUsingXaml)
91             {
92                 view.themeData?.selectorData?.ClearBackground(view);
93
94                 if (newValue is Selector<Color> selector)
95                 {
96                     if (selector.HasAll()) view.SetBackgroundColor(selector.All);
97                     else view.EnsureSelectorData().BackgroundColor = new TriggerableSelector<Color>(view, selector, view.SetBackgroundColor, true);
98                 }
99                 else
100                 {
101                     view.SetBackgroundColor((Color)newValue);
102                 }
103
104             }
105             else
106             {
107                 view.SetBackgroundColor((Color)newValue);
108             }
109         }
110
111         internal static object GetInternalBackgroundColorProperty(BindableObject bindable)
112         {
113             var view = (View)bindable;
114
115             if (view.internalBackgroundColor == null)
116             {
117                 view.internalBackgroundColor = new Color(view.OnBackgroundColorChanged, 0, 0, 0, 0);
118             }
119
120             int visualType = (int)Visual.Type.Invalid;
121             Interop.View.InternalRetrievingVisualPropertyInt(view.SwigCPtr, Property.BACKGROUND, Visual.Property.Type, out visualType);
122             if (visualType == (int)Visual.Type.Color)
123             {
124                 Interop.View.InternalRetrievingVisualPropertyVector4(view.SwigCPtr, Property.BACKGROUND, ColorVisualProperty.MixColor, Color.getCPtr(view.internalBackgroundColor));
125             }
126             return view.internalBackgroundColor;
127         }
128
129         /// <summary>
130         /// BackgroundColorProperty
131         /// </summary>
132         [EditorBrowsable(EditorBrowsableState.Never)]
133 #if REMOVE_READONLY
134         public static BindableProperty BackgroundColorProperty = null;
135
136         internal static BindableProperty GetBackgroundColorProperty()
137         {
138             if (BackgroundColorProperty == null)
139             {
140                 BackgroundColorProperty = BindableProperty.Create(nameof(BackgroundColor), typeof(Color), typeof(View), null,
141                     propertyChanged: SetInternalBackgroundColorProperty, defaultValueCreator: GetInternalBackgroundColorProperty);
142             }
143             return BackgroundColorProperty;
144         }
145 #else
146         public static readonly BindableProperty BackgroundColorProperty = null;
147 #endif
148
149         // ColorProperty
150         internal static void SetInternalColorProperty(BindableObject bindable, object oldValue, object newValue)
151         {
152             var view = (View)bindable;
153
154             view.themeData?.selectorData?.Color?.Reset(view);
155
156             if (newValue is Selector<Color> selector)
157             {
158                 if (selector.HasAll()) view.SetColor(selector.All);
159                 else view.EnsureSelectorData().Color = new TriggerableSelector<Color>(view, selector, view.SetColor, true);
160             }
161             else
162             {
163                 view.SetColor((Color)newValue);
164             }
165         }
166
167         internal static object GetInternalColorProperty(BindableObject bindable)
168         {
169             var view = (View)bindable;
170
171             if (view.internalColor == null)
172             {
173                 view.internalColor = new Color(view.OnColorChanged, 0, 0, 0, 0);
174             }
175             Object.InternalRetrievingPropertyVector4(view.SwigCPtr, View.Property.COLOR, view.internalColor.SwigCPtr);
176             return view.internalColor;
177         }
178
179         /// <summary>
180         /// ColorProperty
181         /// </summary>
182         [EditorBrowsable(EditorBrowsableState.Never)]
183 #if REMOVE_READONLY
184         public static BindableProperty ColorProperty = null;
185
186         internal static BindableProperty GetColorProperty()
187         {
188             if (ColorProperty == null)
189             {
190                 ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(View), null,
191                     propertyChanged: SetInternalColorProperty, defaultValueCreator: GetInternalColorProperty);
192             }
193             return ColorProperty;
194         }
195 #else
196         public static readonly BindableProperty ColorProperty = null;
197 #endif
198
199         // ColorRedProperty
200         internal static void SetInternalColorRedProperty(BindableObject bindable, object oldValue, object newValue)
201         {
202             var view = (View)bindable;
203             view.SetColorRed((float?)newValue);
204         }
205
206         internal static object GetInternalColorRedProperty(BindableObject bindable)
207         {
208             var view = (View)bindable;
209             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorRed);
210         }
211
212         /// <summary>
213         /// ColorRedProperty
214         /// </summary>
215         [EditorBrowsable(EditorBrowsableState.Never)]
216 #if REMOVE_READONLY
217         public static BindableProperty ColorRedProperty = null;
218
219         internal static BindableProperty GetColorRedProperty()
220         {
221             if (ColorRedProperty == null)
222             {
223                 ColorRedProperty = BindableProperty.Create(nameof(ColorRed), typeof(float), typeof(View), default(float),
224                     propertyChanged: SetInternalColorRedProperty, defaultValueCreator: GetInternalColorRedProperty);
225             }
226             return ColorRedProperty;
227         }
228 #else
229         public static readonly BindableProperty ColorRedProperty = null;
230 #endif
231
232         // ColorGreenProperty
233         internal static void SetInternalColorGreenProperty(BindableObject bindable, object oldValue, object newValue)
234         {
235             var view = (View)bindable;
236             view.SetColorGreen((float?)newValue);
237
238         }
239
240         internal static object GetInternalColorGreenProperty(BindableObject bindable)
241         {
242             var view = (View)bindable;
243             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorGreen);
244
245         }
246
247         /// <summary>
248         /// ColorGreenProperty
249         /// </summary>
250         [EditorBrowsable(EditorBrowsableState.Never)]
251 #if REMOVE_READONLY
252         public static BindableProperty ColorGreenProperty = null;
253
254         internal static BindableProperty GetColorGreenProperty()
255         {
256             if (ColorGreenProperty == null)
257             {
258                 ColorGreenProperty = BindableProperty.Create(nameof(ColorGreen), typeof(float), typeof(View), default(float),
259                     propertyChanged: SetInternalColorGreenProperty, defaultValueCreator: GetInternalColorGreenProperty);
260             }
261             return ColorGreenProperty;
262         }
263 #else
264         public static readonly BindableProperty ColorGreenProperty = null;
265 #endif
266
267         // ColorBlueProperty
268         internal static void SetInternalColorBlueProperty(BindableObject bindable, object oldValue, object newValue)
269         {
270             var view = (View)bindable;
271             view.SetColorBlue((float?)newValue);
272
273         }
274
275         internal static object GetInternalColorBlueProperty(BindableObject bindable)
276         {
277             var view = (View)bindable;
278             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ColorBlue);
279
280         }
281
282         /// <summary>
283         /// ColorBlueProperty
284         /// </summary>
285         [EditorBrowsable(EditorBrowsableState.Never)]
286 #if REMOVE_READONLY
287         public static BindableProperty ColorBlueProperty = null;
288
289         internal static BindableProperty GetColorBlueProperty()
290         {
291             if (ColorBlueProperty == null)
292             {
293                 ColorBlueProperty = BindableProperty.Create(nameof(ColorBlue), typeof(float), typeof(View), default(float),
294                     propertyChanged: SetInternalColorBlueProperty, defaultValueCreator: GetInternalColorBlueProperty);
295             }
296             return ColorBlueProperty;
297         }
298 #else
299         public static readonly BindableProperty ColorBlueProperty = null;
300 #endif
301
302         /// <summary> BackgroundImageProperty </summary>
303         [EditorBrowsable(EditorBrowsableState.Never)]
304         public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create(nameof(BackgroundImage), typeof(string), typeof(View), default(string),
305             propertyChanged: (bindable, oldValue, newValue) =>
306             {
307                 if (String.Equals(oldValue, newValue))
308                 {
309                     NUILog.Debug($"oldValue={oldValue} newValue={newValue} are same. just return here");
310                     return;
311                 }
312
313                 var view = (View)bindable;
314
315                 if (view.themeData?.selectorData != null)
316                 {
317                     view.themeData.selectorData.BackgroundColor?.Reset(view);
318                     view.themeData.selectorData.BackgroundImage?.Reset(view);
319                 }
320
321                 if (newValue is Selector<string> selector)
322                 {
323                     if (selector.HasAll()) view.SetBackgroundImage(selector.All);
324                     else view.EnsureSelectorData().BackgroundImage = new TriggerableSelector<string>(view, selector, view.SetBackgroundImage, true);
325                 }
326                 else
327                 {
328                     view.SetBackgroundImage((string)newValue);
329                 }
330             },
331             defaultValueCreator: (bindable) =>
332             {
333                 var view = (View)bindable;
334                 string backgroundImage = "";
335
336                 Interop.View.InternalRetrievingVisualPropertyString(view.SwigCPtr, Property.BACKGROUND, ImageVisualProperty.URL, out backgroundImage);
337
338                 return backgroundImage;
339             }
340         );
341
342
343         /// <summary>BackgroundImageBorderProperty</summary>
344         [EditorBrowsable(EditorBrowsableState.Never)]
345         public static readonly BindableProperty BackgroundImageBorderProperty = BindableProperty.Create(nameof(BackgroundImageBorder), typeof(Rectangle), typeof(View), default(Rectangle), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
346         {
347             var view = (View)bindable;
348
349             view.themeData?.selectorData?.BackgroundImageBorder?.Reset(view);
350
351             if (newValue is Selector<Rectangle> selector)
352             {
353                 if (selector.HasAll()) view.SetBackgroundImageBorder(selector.All);
354                 else view.EnsureSelectorData().BackgroundImageBorder = new TriggerableSelector<Rectangle>(view, selector, view.SetBackgroundImageBorder, true);
355             }
356             else
357             {
358                 view.SetBackgroundImageBorder((Rectangle)newValue);
359             }
360         }),
361         defaultValueCreator: (bindable) =>
362         {
363             var view = (View)bindable;
364
365             return view.backgroundExtraData?.BackgroundImageBorder;
366         });
367
368         /// <summary>
369         /// BackgroundProperty
370         /// </summary>
371         [EditorBrowsable(EditorBrowsableState.Never)]
372         public static readonly BindableProperty BackgroundProperty = BindableProperty.Create(nameof(Background), typeof(PropertyMap), typeof(View), null,
373             propertyChanged: (bindable, oldValue, newValue) =>
374             {
375                 var view = (View)bindable;
376                 if (newValue != null)
377                 {
378                     var propertyValue = new PropertyValue((PropertyMap)newValue);
379                     Object.SetProperty(view.SwigCPtr, Property.BACKGROUND, propertyValue);
380
381                     view.backgroundExtraData = null;
382
383                     // Background extra data is not valid anymore. We should ignore lazy UpdateBackgroundExtraData
384                     view.backgroundExtraDataUpdatedFlag = BackgroundExtraDataUpdatedFlag.None;
385                     if (view.backgroundExtraDataUpdateProcessAttachedFlag)
386                     {
387                         ProcessorController.Instance.ProcessorOnceEvent -= view.UpdateBackgroundExtraData;
388                         view.backgroundExtraDataUpdateProcessAttachedFlag = false;
389                     }
390
391                     propertyValue.Dispose();
392                     propertyValue = null;
393                 }
394             },
395             defaultValueCreator: (bindable) =>
396             {
397                 var view = (View)bindable;
398
399                 // Sync as current properties
400                 view.UpdateBackgroundExtraData();
401
402                 PropertyMap tmp = new PropertyMap();
403                 var propertyValue = Object.GetProperty(view.SwigCPtr, Property.BACKGROUND);
404                 propertyValue.Get(tmp);
405                 propertyValue.Dispose();
406                 propertyValue = null;
407                 return tmp;
408             }
409         );
410
411         /// <summary>
412         /// StateProperty
413         /// </summary>
414         [EditorBrowsable(EditorBrowsableState.Never)]
415         public static readonly BindableProperty StateProperty = BindableProperty.Create(nameof(State), typeof(States), typeof(View), States.Normal, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
416         {
417             var view = (View)bindable;
418             if (newValue != null)
419             {
420                 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.STATE, (int)newValue);
421             }
422         }),
423         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
424         {
425             var view = (View)bindable;
426             int temp = 0;
427             temp = Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.STATE);
428             switch (temp)
429             {
430                 case 0: return States.Normal;
431                 case 1: return States.Focused;
432                 case 2: return States.Disabled;
433                 default: return States.Normal;
434             }
435         }));
436
437         /// <summary>
438         /// SubStateProperty
439         /// </summary>
440         [EditorBrowsable(EditorBrowsableState.Never)]
441         public static readonly BindableProperty SubStateProperty = BindableProperty.Create(nameof(SubState), typeof(States), typeof(View), States.Normal, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
442         {
443             var view = (View)bindable;
444             string valueToString = "";
445             if (newValue != null)
446             {
447                 valueToString = ((States)newValue).GetDescription();
448                 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.SubState, valueToString);
449             }
450         }),
451         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
452         {
453             var view = (View)bindable;
454             string temp;
455             temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.SubState);
456             return temp.GetValueByDescription<States>();
457         }));
458
459         /// <summary>
460         /// TooltipProperty
461         /// </summary>
462         [EditorBrowsable(EditorBrowsableState.Never)]
463         public static readonly BindableProperty TooltipProperty = BindableProperty.Create(nameof(Tooltip), typeof(PropertyMap), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
464         {
465             var view = (View)bindable;
466             if (newValue != null)
467             {
468                 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue));
469             }
470         }),
471         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
472         {
473             var view = (View)bindable;
474             Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
475             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.TOOLTIP).Get(temp);
476             return temp;
477         }));
478
479         /// <summary>
480         /// FlexProperty
481         /// </summary>
482         [EditorBrowsable(EditorBrowsableState.Never)]
483         public static readonly BindableProperty FlexProperty = BindableProperty.Create(nameof(Flex), typeof(float), typeof(View), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
484         {
485             var view = (View)bindable;
486             if (newValue != null)
487             {
488                 Object.InternalSetPropertyFloat(view.SwigCPtr, FlexContainer.ChildProperty.FLEX, (float)newValue);
489             }
490         }),
491         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
492         {
493             var view = (View)bindable;
494             return Object.InternalGetPropertyFloat(view.SwigCPtr, FlexContainer.ChildProperty.FLEX);
495         }));
496
497         /// <summary>
498         /// AlignSelfProperty
499         /// </summary>
500         [EditorBrowsable(EditorBrowsableState.Never)]
501         public static readonly BindableProperty AlignSelfProperty = BindableProperty.Create(nameof(AlignSelf), typeof(int), typeof(View), default(int), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
502         {
503             var view = (View)bindable;
504             if (newValue != null)
505             {
506                 Object.InternalSetPropertyInt(view.SwigCPtr, FlexContainer.ChildProperty.AlignSelf, (int)newValue);
507             }
508         }),
509         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
510         {
511             var view = (View)bindable;
512             return Object.InternalGetPropertyInt(view.SwigCPtr, FlexContainer.ChildProperty.AlignSelf);
513         }));
514
515         /// <summary>
516         /// FlexMarginProperty
517         /// </summary>
518         [EditorBrowsable(EditorBrowsableState.Never)]
519         public static readonly BindableProperty FlexMarginProperty = BindableProperty.Create(nameof(FlexMargin), typeof(Vector4), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
520         {
521             var view = (View)bindable;
522             if (newValue != null)
523             {
524                 Object.InternalSetPropertyVector4(view.SwigCPtr, FlexContainer.ChildProperty.FlexMargin, ((Vector4)newValue).SwigCPtr);
525             }
526         }),
527         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
528         {
529             var view = (View)bindable;
530             Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
531             Object.InternalRetrievingPropertyVector4(view.SwigCPtr, FlexContainer.ChildProperty.FlexMargin, temp.SwigCPtr);
532             return temp;
533         }));
534
535         // CellIndexProperty
536         internal static void SetInternalCellIndexProperty(BindableObject bindable, object oldValue, object newValue)
537         {
538             var view = (View)bindable;
539             if (newValue != null)
540             {
541                 Object.InternalSetPropertyVector2(view.SwigCPtr, TableView.ChildProperty.CellIndex, ((Vector2)newValue).SwigCPtr);
542             }
543
544         }
545
546         internal static object GetInternalCellIndexProperty(BindableObject bindable)
547         {
548             var view = (View)bindable;
549             if (view.internalCellIndex == null)
550             {
551                 view.internalCellIndex = new Vector2(view.OnCellIndexChanged, 0, 0);
552             }
553             Object.InternalRetrievingPropertyVector2(view.SwigCPtr, TableView.ChildProperty.CellIndex, view.internalCellIndex.SwigCPtr);
554             return view.internalCellIndex;
555
556         }
557
558         /// <summary>
559         /// CellIndexProperty
560         /// </summary>
561         [EditorBrowsable(EditorBrowsableState.Never)]
562 #if REMOVE_READONLY
563         internal static BindableProperty GetCellIndexProperty()
564         {
565             if (CellIndexProperty == null)
566             {
567                 CellIndexProperty = BindableProperty.Create(nameof(CellIndex), typeof(Vector2), typeof(View), null,
568                     propertyChanged: SetInternalCellIndexProperty, defaultValueCreator: GetInternalCellIndexProperty);
569             }
570             return CellIndexProperty;
571         }
572
573         public static BindableProperty CellIndexProperty = null;
574 #else
575         public static readonly BindableProperty CellIndexProperty = null;
576 #endif
577
578         /// <summary>
579         /// RowSpanProperty
580         /// </summary>
581         [EditorBrowsable(EditorBrowsableState.Never)]
582         public static readonly BindableProperty RowSpanProperty = BindableProperty.Create(nameof(RowSpan), typeof(float), typeof(View), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
583         {
584             var view = (View)bindable;
585             if (newValue != null)
586             {
587                 Object.InternalSetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.RowSpan, (float)newValue);
588             }
589         }),
590         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
591         {
592             var view = (View)bindable;
593             return Object.InternalGetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.RowSpan);
594         }));
595
596         /// <summary>
597         /// ColumnSpanProperty
598         /// </summary>
599         [EditorBrowsable(EditorBrowsableState.Never)]
600         public static readonly BindableProperty ColumnSpanProperty = BindableProperty.Create(nameof(ColumnSpan), typeof(float), typeof(View), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
601         {
602             var view = (View)bindable;
603             if (newValue != null)
604             {
605                 Object.InternalSetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.ColumnSpan, (float)newValue);
606             }
607         }),
608         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
609         {
610             var view = (View)bindable;
611             return Object.InternalGetPropertyFloat(view.SwigCPtr, TableView.ChildProperty.ColumnSpan);
612         }));
613
614         /// <summary>
615         /// CellHorizontalAlignmentProperty
616         /// </summary>
617         [EditorBrowsable(EditorBrowsableState.Never)]
618         public static readonly BindableProperty CellHorizontalAlignmentProperty = BindableProperty.Create(nameof(CellHorizontalAlignment), typeof(HorizontalAlignmentType), typeof(View), HorizontalAlignmentType.Left, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
619         {
620             var view = (View)bindable;
621             string valueToString = "";
622
623             if (newValue != null)
624             {
625                 valueToString = ((HorizontalAlignmentType)newValue).GetDescription();
626                 Object.InternalSetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment, valueToString);
627             }
628         }),
629         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
630         {
631             var view = (View)bindable;
632             string temp;
633             temp = Object.InternalGetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellHorizontalAlignment);
634             return temp.GetValueByDescription<HorizontalAlignmentType>();
635         }));
636
637         /// <summary>
638         /// CellVerticalAlignmentProperty
639         /// </summary>
640         [EditorBrowsable(EditorBrowsableState.Never)]
641         public static readonly BindableProperty CellVerticalAlignmentProperty = BindableProperty.Create(nameof(CellVerticalAlignment), typeof(VerticalAlignmentType), typeof(View), VerticalAlignmentType.Top, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
642         {
643             var view = (View)bindable;
644             string valueToString = "";
645
646             if (newValue != null)
647             {
648                 valueToString = ((VerticalAlignmentType)newValue).GetDescription();
649                 Object.InternalSetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellVerticalAlignment, valueToString);
650             }
651         }),
652         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
653         {
654             var view = (View)bindable;
655             string temp;
656             temp = Object.InternalGetPropertyString(view.SwigCPtr, TableView.ChildProperty.CellVerticalAlignment);
657             return temp.GetValueByDescription<VerticalAlignmentType>();
658         }));
659
660         /// <summary>
661         /// "DO not use this, that will be deprecated. Use 'View Weight' instead of BindableProperty"
662         /// This needs to be hidden as inhouse API until all applications using it have been updated.  Do not make public.
663         /// </summary>
664         [EditorBrowsable(EditorBrowsableState.Never)]
665         public static readonly BindableProperty WeightProperty = BindableProperty.Create(nameof(Weight), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
666         {
667             var view = (View)bindable;
668             if (newValue != null)
669             {
670                 view.Weight = (float)newValue;
671             }
672         },
673
674         defaultValueCreator: (bindable) =>
675         {
676             var view = (View)bindable;
677             return view.Weight;
678         });
679
680         /// <summary>
681         /// LeftFocusableViewProperty
682         /// </summary>
683         [EditorBrowsable(EditorBrowsableState.Never)]
684         public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create(nameof(View.LeftFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
685         {
686             var view = (View)bindable;
687             if (newValue != null) { view.LeftFocusableViewId = (int)(newValue as View)?.GetId(); }
688             else { view.LeftFocusableViewId = -1; }
689         },
690         defaultValueCreator: (bindable) =>
691         {
692             var view = (View)bindable;
693             if (view.LeftFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.LeftFocusableViewId); }
694             return null;
695         });
696
697         /// <summary>
698         /// RightFocusableViewProperty
699         /// </summary>
700         [EditorBrowsable(EditorBrowsableState.Never)]
701         public static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create(nameof(View.RightFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
702         {
703             var view = (View)bindable;
704             if (newValue != null) { view.RightFocusableViewId = (int)(newValue as View)?.GetId(); }
705             else { view.RightFocusableViewId = -1; }
706         },
707         defaultValueCreator: (bindable) =>
708         {
709             var view = (View)bindable;
710             if (view.RightFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.RightFocusableViewId); }
711             return null;
712         });
713
714         /// <summary>
715         /// UpFocusableViewProperty
716         /// </summary>
717         [EditorBrowsable(EditorBrowsableState.Never)]
718         public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create(nameof(View.UpFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
719         {
720             var view = (View)bindable;
721             if (newValue != null) { view.UpFocusableViewId = (int)(newValue as View)?.GetId(); }
722             else { view.UpFocusableViewId = -1; }
723         },
724         defaultValueCreator: (bindable) =>
725         {
726             var view = (View)bindable;
727             if (view.UpFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.UpFocusableViewId); }
728             return null;
729         });
730
731         /// <summary>
732         /// DownFocusableViewProperty
733         /// </summary>
734         [EditorBrowsable(EditorBrowsableState.Never)]
735         public static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create(nameof(View.DownFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
736         {
737             var view = (View)bindable;
738             if (newValue != null) { view.DownFocusableViewId = (int)(newValue as View)?.GetId(); }
739             else { view.DownFocusableViewId = -1; }
740         },
741         defaultValueCreator: (bindable) =>
742         {
743             var view = (View)bindable;
744             if (view.DownFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.DownFocusableViewId); }
745             return null;
746         });
747
748         /// <summary>
749         /// ClockwiseFocusableViewProperty
750         /// </summary>
751         [EditorBrowsable(EditorBrowsableState.Never)]
752         public static readonly BindableProperty ClockwiseFocusableViewProperty = BindableProperty.Create(nameof(View.ClockwiseFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
753         {
754             var view = (View)bindable;
755             if (newValue != null && (newValue is View)) { view.ClockwiseFocusableViewId = (int)(newValue as View)?.GetId(); }
756             else { view.ClockwiseFocusableViewId = -1; }
757         },
758         defaultValueCreator: (bindable) =>
759         {
760             var view = (View)bindable;
761             if (view.ClockwiseFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.ClockwiseFocusableViewId); }
762             return null;
763         });
764
765         /// <summary>
766         /// CounterClockwiseFocusableViewProperty
767         /// </summary>
768         [EditorBrowsable(EditorBrowsableState.Never)]
769         public static readonly BindableProperty CounterClockwiseFocusableViewProperty = BindableProperty.Create(nameof(View.CounterClockwiseFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
770         {
771             var view = (View)bindable;
772             if (newValue != null && (newValue is View)) { view.CounterClockwiseFocusableViewId = (int)(newValue as View)?.GetId(); }
773             else { view.CounterClockwiseFocusableViewId = -1; }
774         },
775         defaultValueCreator: (bindable) =>
776         {
777             var view = (View)bindable;
778             if (view.CounterClockwiseFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.CounterClockwiseFocusableViewId); }
779             return null;
780         });
781
782         /// <summary>
783         /// FocusableProperty
784         /// </summary>
785         [EditorBrowsable(EditorBrowsableState.Never)]
786         public static readonly BindableProperty FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
787         {
788             var view = (View)bindable;
789             if (newValue != null) { view.SetKeyboardFocusable((bool)newValue); }
790         },
791         defaultValueCreator: (bindable) =>
792         {
793             var view = (View)bindable;
794             return view.IsKeyboardFocusable();
795         });
796
797         /// <summary>
798         /// FocusableChildrenProperty
799         /// </summary>
800         [EditorBrowsable(EditorBrowsableState.Never)]
801         public static readonly BindableProperty FocusableChildrenProperty = BindableProperty.Create(nameof(FocusableChildren), typeof(bool), typeof(View), true, propertyChanged: (bindable, oldValue, newValue) =>
802         {
803             var view = (View)bindable;
804             if (newValue != null) { view.SetKeyboardFocusableChildren((bool)newValue); }
805         },
806         defaultValueCreator: (bindable) =>
807         {
808             var view = (View)bindable;
809             return view.AreChildrenKeyBoardFocusable();
810         });
811
812         /// <summary>
813         /// FocusableInTouchProperty
814         /// </summary>
815         [EditorBrowsable(EditorBrowsableState.Never)]
816         public static readonly BindableProperty FocusableInTouchProperty = BindableProperty.Create(nameof(FocusableInTouch), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
817         {
818             var view = (View)bindable;
819             if (newValue != null) { view.SetFocusableInTouch((bool)newValue); }
820         },
821         defaultValueCreator: (bindable) =>
822         {
823             var view = (View)bindable;
824             return view.IsFocusableInTouch();
825         });
826
827         //Size2DProperty
828         internal static void SetInternalSize2DProperty(BindableObject bindable, object oldValue, object newValue)
829         {
830             var view = (View)bindable;
831             if (newValue != null)
832             {
833                 // Size property setter is only used by user.
834                 // Framework code uses SetSize() instead of Size property setter.
835                 // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height.
836                 // SuggestedMinimumWidth/Height is used by Layout calculation.
837                 int width = ((Size2D)newValue).Width;
838                 int height = ((Size2D)newValue).Height;
839                 view.userSizeWidth = (float)width;
840                 view.userSizeHeight = (float)height;
841
842                 bool relayoutRequired = false;
843                 // To avoid duplicated size setup, change internal policy directly.
844                 if (view.widthPolicy != width)
845                 {
846                     view.widthPolicy = width;
847                     relayoutRequired = true;
848                 }
849                 if (view.heightPolicy != height)
850                 {
851                     view.heightPolicy = height;
852                     relayoutRequired = true;
853                 }
854                 if (relayoutRequired)
855                 {
856                     view.layout?.RequestLayout();
857                 }
858
859                 Object.InternalSetPropertyVector2ActualVector3(view.SwigCPtr, View.Property.SIZE, ((Size2D)newValue).SwigCPtr);
860             }
861         }
862
863         internal static object GetInternalSize2DProperty(BindableObject bindable)
864         {
865             var view = (View)bindable;
866             if (view.internalSize2D == null)
867             {
868                 view.internalSize2D = new Size2D(view.OnSize2DChanged, 0, 0);
869             }
870             Object.InternalRetrievingPropertyVector2ActualVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize2D.SwigCPtr);
871
872             return view.internalSize2D;
873         }
874
875         /// <summary>
876         /// Size2DProperty
877         /// </summary>
878         [EditorBrowsable(EditorBrowsableState.Never)]
879 #if REMOVE_READONLY
880         internal static BindableProperty GetSize2DProperty()
881         {
882             if (Size2DProperty == null)
883             {
884                 Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(View), null,
885                     propertyChanged: SetInternalSize2DProperty, defaultValueCreator: GetInternalSize2DProperty);
886             }
887             return Size2DProperty;
888         }
889
890         public static BindableProperty Size2DProperty = null;
891 #else
892         public static readonly BindableProperty Size2DProperty = null;
893 #endif
894
895         /// <summary>
896         /// OpacityProperty
897         /// </summary>
898         [EditorBrowsable(EditorBrowsableState.Never)]
899         public static readonly BindableProperty OpacityProperty = BindableProperty.Create(nameof(Opacity), typeof(float), typeof(View), default(float), propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
900         {
901             var view = (View)bindable;
902
903             view.themeData?.selectorData?.Opacity?.Reset(view);
904
905             if (newValue is Selector<float?> selector)
906             {
907                 if (selector.HasAll()) view.SetOpacity(selector.All);
908                 else view.EnsureSelectorData().Opacity = new TriggerableSelector<float?>(view, selector, view.SetOpacity, true);
909             }
910             else
911             {
912                 view.SetOpacity((float?)newValue);
913             }
914         }),
915         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
916         {
917             var view = (View)bindable;
918             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.OPACITY);
919         }));
920
921         // Position2DProperty
922         internal static void SetInternalPosition2DProperty(BindableObject bindable, object oldValue, object newValue)
923         {
924             var view = (View)bindable;
925             if (newValue != null)
926             {
927                 Object.InternalSetPropertyVector2ActualVector3(view.SwigCPtr, View.Property.POSITION, ((Position2D)newValue).SwigCPtr);
928             }
929         }
930
931         internal static object GetInternalPosition2DProperty(BindableObject bindable)
932         {
933             var view = (View)bindable;
934             if (view.internalPosition2D == null)
935             {
936                 view.internalPosition2D = new Position2D(view.OnPosition2DChanged, 0, 0);
937             }
938             Object.InternalRetrievingPropertyVector2ActualVector3(view.SwigCPtr, View.Property.POSITION, view.internalPosition2D.SwigCPtr);
939             return view.internalPosition2D;
940         }
941
942         /// <summary>
943         /// Position2DProperty
944         /// </summary>
945         [EditorBrowsable(EditorBrowsableState.Never)]
946 #if REMOVE_READONLY
947         internal static BindableProperty GetPosition2DProperty()
948         {
949             if (Position2DProperty == null)
950             {
951                 Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(View), null,
952                     propertyChanged: SetInternalPosition2DProperty, defaultValueCreator: GetInternalPosition2DProperty);
953             }
954             return Position2DProperty;
955         }
956
957         public static BindableProperty Position2DProperty = null;
958 #else
959         public static readonly BindableProperty Position2DProperty = null;
960 #endif
961
962         /// <summary>
963         /// PositionUsesPivotPointProperty
964         /// </summary>
965         [EditorBrowsable(EditorBrowsableState.Never)]
966         public static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool), typeof(View), true, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
967         {
968             var view = (View)bindable;
969             if (newValue != null)
970             {
971                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.PositionUsesAnchorPoint, (bool)newValue);
972             }
973         }),
974         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
975         {
976             var view = (View)bindable;
977             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.PositionUsesAnchorPoint);
978         }));
979
980         /// <summary>
981         /// SiblingOrderProperty
982         /// </summary>
983         [EditorBrowsable(EditorBrowsableState.Never)]
984         public static readonly BindableProperty SiblingOrderProperty = BindableProperty.Create(nameof(SiblingOrder), typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) =>
985         {
986             var view = (View)bindable;
987             int value;
988             if (newValue != null)
989             {
990                 value = (int)newValue;
991                 if (value < 0)
992                 {
993                     NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0.");
994                     return;
995                 }
996                 var siblings = view.GetParent()?.Children;
997                 if (siblings != null)
998                 {
999                     int currentOrder = siblings.IndexOf(view);
1000                     if (value != currentOrder)
1001                     {
1002                         if (value == 0) { view.LowerToBottom(); }
1003                         else if (value < siblings.Count - 1)
1004                         {
1005                             if (value > currentOrder) { view.RaiseAbove(siblings[value]); }
1006                             else { view.LowerBelow(siblings[value]); }
1007                         }
1008                         else { view.RaiseToTop(); }
1009                     }
1010                 }
1011             }
1012         },
1013         defaultValueCreator: (bindable) =>
1014         {
1015             var view = (View)bindable;
1016             var parentChildren = view.GetParent()?.Children;
1017             int currentOrder = 0;
1018             if (parentChildren != null)
1019             {
1020                 currentOrder = parentChildren.IndexOf(view);
1021
1022                 if (currentOrder < 0) { return 0; }
1023                 else if (currentOrder < parentChildren.Count) { return currentOrder; }
1024             }
1025
1026             return 0;
1027         });
1028
1029         // ParentOriginProperty
1030         internal static void SetInternalParentOriginProperty(BindableObject bindable, object oldValue, object newValue)
1031         {
1032             var view = (View)bindable;
1033             if (newValue != null)
1034             {
1035                 Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.ParentOrigin, ((Position)newValue).SwigCPtr);
1036             }
1037         }
1038
1039         internal static object GetInternalParentOriginProperty(BindableObject bindable)
1040         {
1041             var view = (View)bindable;
1042             Position temp = new Position(0.0f, 0.0f, 0.0f);
1043             Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.ParentOrigin, temp.SwigCPtr);
1044             return temp;
1045         }
1046
1047         /// <summary>
1048         /// ParentOriginProperty
1049         /// </summary>
1050         [EditorBrowsable(EditorBrowsableState.Never)]
1051 #if REMOVE_READONLY
1052         internal static BindableProperty GetParentOriginProperty()
1053         {
1054             if (ParentOriginProperty == null)
1055             {
1056                 ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(View), null,
1057                     propertyChanged: SetInternalParentOriginProperty, defaultValueCreator: GetInternalParentOriginProperty);
1058             }
1059             return ParentOriginProperty;
1060         }
1061
1062         public static BindableProperty ParentOriginProperty = null;
1063 #else
1064         public static readonly BindableProperty ParentOriginProperty = null;
1065 #endif
1066
1067         // PivotPointProperty
1068         internal static void SetInternalPivotPointProperty(BindableObject bindable, object oldValue, object newValue)
1069         {
1070             var view = (View)bindable;
1071             if (newValue != null)
1072             {
1073                 view.SetAnchorPoint((Position)newValue);
1074             }
1075         }
1076
1077         internal static object GetInternalPivotPointProperty(BindableObject bindable)
1078         {
1079             var view = (View)bindable;
1080             if (view.internalPivotPoint == null)
1081             {
1082                 view.internalPivotPoint = new Position(view.OnPivotPointChanged, 0, 0, 0);
1083             }
1084             Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.AnchorPoint, view.internalPivotPoint.SwigCPtr);
1085             return view.internalPivotPoint;
1086         }
1087
1088         /// <summary>
1089         /// PivotPointProperty
1090         /// </summary>
1091         [EditorBrowsable(EditorBrowsableState.Never)]
1092 #if REMOVE_READONLY
1093         internal static BindableProperty GetPivotPointProperty()
1094         {
1095             if (PivotPointProperty == null)
1096             {
1097                 PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(View), null,
1098                     propertyChanged: SetInternalPivotPointProperty, defaultValueCreator: GetInternalPivotPointProperty);
1099             }
1100             return PivotPointProperty;
1101         }
1102
1103         public static BindableProperty PivotPointProperty = null;
1104 #else
1105         public static readonly BindableProperty PivotPointProperty = null;
1106 #endif
1107         
1108         // SizeWidthProperty
1109         internal static void SetInternalSizeWidthProperty(BindableObject bindable, object oldValue, object newValue)
1110         {
1111             var view = (View)bindable;
1112             if (newValue != null)
1113             {
1114                 // Size property setter is only used by user.
1115                 // Framework code uses SetSize() instead of Size property setter.
1116                 // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height.
1117                 // SuggestedMinimumWidth/Height is used by Layout calculation.
1118                 float width = (float)newValue;
1119                 view.userSizeWidth = width;
1120
1121                 // To avoid duplicated size setup, change internal policy directly.
1122                 int widthPolicy = (int)System.Math.Ceiling(width);
1123                 if (view.widthPolicy != widthPolicy)
1124                 {
1125                     view.widthPolicy = widthPolicy;
1126                     view.layout?.RequestLayout();
1127                 }
1128
1129                 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.SizeWidth, width);
1130             }
1131         }
1132
1133         internal static object GetInternalSizeWidthProperty(BindableObject bindable)
1134         {
1135             var view = (View)bindable;
1136             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.SizeWidth);
1137         }
1138
1139         /// <summary>
1140         /// SizeWidthProperty
1141         /// </summary>
1142         [EditorBrowsable(EditorBrowsableState.Never)]
1143 #if REMOVE_READONLY
1144         internal static BindableProperty GetSizeWidthProperty()
1145         {
1146             if (SizeWidthProperty == null)
1147             {
1148                 SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float), typeof(View), default(float),
1149                     propertyChanged: SetInternalSizeWidthProperty, defaultValueCreator: GetInternalSizeWidthProperty);
1150             }
1151             return SizeWidthProperty;
1152         }
1153
1154         public static BindableProperty SizeWidthProperty = null;
1155 #else
1156         public static readonly BindableProperty SizeWidthProperty = null;
1157 #endif        
1158
1159         // SizeHeightProperty
1160         internal static void SetInternalSizeHeightProperty(BindableObject bindable, object oldValue, object newValue)
1161         {
1162             var view = (View)bindable;
1163             if (newValue != null)
1164             {
1165                 // Size property setter is only used by user.
1166                 // Framework code uses SetSize() instead of Size property setter.
1167                 // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height.
1168                 // SuggestedMinimumWidth/Height is used by Layout calculation.
1169                 float height = (float)newValue;
1170                 view.userSizeHeight = height;
1171
1172                 // To avoid duplicated size setup, change internal policy directly.
1173                 int heightPolicy = (int)System.Math.Ceiling(height);
1174                 if (view.heightPolicy != heightPolicy)
1175                 {
1176                     view.heightPolicy = heightPolicy;
1177                     view.layout?.RequestLayout();
1178                 }
1179
1180                 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.SizeHeight, height);
1181             }
1182         }
1183
1184         internal static object GetInternalSizeHeightProperty(BindableObject bindable)
1185         {
1186             var view = (View)bindable;
1187             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.SizeHeight);
1188         }
1189
1190         /// <summary>
1191         /// SizeHeightProperty
1192         /// </summary>
1193         [EditorBrowsable(EditorBrowsableState.Never)]
1194 #if REMOVE_READONLY
1195         internal static BindableProperty GetSizeHeightProperty()
1196         {
1197             if (SizeHeightProperty == null)
1198             {
1199                 SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float), typeof(View), default(float),
1200                     propertyChanged: SetInternalSizeHeightProperty, defaultValueCreator: GetInternalSizeHeightProperty);
1201             }
1202             return SizeHeightProperty;
1203         }
1204
1205         public static BindableProperty SizeHeightProperty = null;
1206 #else
1207         public static readonly BindableProperty SizeHeightProperty = null;
1208 #endif
1209
1210         // PositionProperty
1211         internal static void SetInternalPositionProperty(BindableObject bindable, object oldValue, object newValue)
1212         {
1213             var view = (View)bindable;
1214             if (newValue != null)
1215             {
1216                 Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.POSITION, ((Position)newValue).SwigCPtr);
1217             }
1218         }
1219
1220         internal static object GetInternalPositionProperty(BindableObject bindable)
1221         {
1222             var view = (View)bindable;
1223             if (view.internalPosition == null)
1224             {
1225                 view.internalPosition = new Position(view.OnPositionChanged, 0, 0, 0);
1226             }
1227             Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.POSITION, view.internalPosition.SwigCPtr);
1228             return view.internalPosition;
1229         }
1230
1231         /// <summary>
1232         /// PositionProperty
1233         /// </summary>
1234         [EditorBrowsable(EditorBrowsableState.Never)]
1235 #if REMOVE_READONLY
1236         internal static BindableProperty GetPositionProperty()
1237         {
1238             if (PositionProperty == null)
1239             {
1240                 PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(View), null,
1241                     propertyChanged: SetInternalPositionProperty, defaultValueCreator: GetInternalPositionProperty);
1242             }
1243             return PositionProperty;
1244         }
1245
1246         public static BindableProperty PositionProperty = null;
1247 #else
1248         public static readonly BindableProperty PositionProperty = null;
1249 #endif
1250         
1251         // PositionXProperty
1252         internal static void SetInternalPositionXProperty(BindableObject bindable, object oldValue, object newValue)
1253         {
1254             var view = (View)bindable;
1255             if (newValue != null)
1256             {
1257                 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionX, (float)newValue);
1258             }
1259         }
1260
1261         internal static object GetInternalPositionXProperty(BindableObject bindable)
1262         {
1263             var view = (View)bindable;
1264             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionX);
1265         }
1266
1267         /// <summary>
1268         /// PositionXProperty
1269         /// </summary>
1270         [EditorBrowsable(EditorBrowsableState.Never)]
1271 #if REMOVE_READONLY
1272         internal static BindableProperty GetPositionXProperty()
1273         {
1274             if (PositionXProperty == null)
1275             {
1276                 PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float), typeof(View), default(float),
1277                     propertyChanged: SetInternalPositionXProperty, defaultValueCreator: GetInternalPositionXProperty);
1278             }
1279             return PositionXProperty;
1280         }
1281
1282         public static BindableProperty PositionXProperty = null;
1283 #else
1284         public static readonly BindableProperty PositionXProperty = null;
1285 #endif
1286
1287         // PositionYProperty
1288         internal static void SetInternalPositionYProperty(BindableObject bindable, object oldValue, object newValue)
1289         {
1290             var view = (View)bindable;
1291             if (newValue != null)
1292             {
1293                 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionY, (float)newValue);
1294             }
1295         }
1296
1297         internal static object GetInternalPositionYProperty(BindableObject bindable)
1298         {
1299             var view = (View)bindable;
1300             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionY);
1301         }
1302
1303         /// <summary>
1304         /// PositionYProperty
1305         /// </summary>
1306         [EditorBrowsable(EditorBrowsableState.Never)]
1307 #if REMOVE_READONLY
1308         internal static BindableProperty GetPositionYProperty()
1309         {
1310             if (PositionYProperty == null)
1311             {
1312                 PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float), typeof(View), default(float),
1313                 propertyChanged: SetInternalPositionYProperty, defaultValueCreator: GetInternalPositionYProperty);
1314             }
1315             return PositionYProperty;
1316         }
1317
1318         public static BindableProperty PositionYProperty = null;
1319 #else
1320         public static readonly BindableProperty PositionYProperty = null;
1321 #endif
1322         internal static void SetInternalPositionZProperty(BindableObject bindable, object oldValue, object newValue)
1323         {
1324             var view = (View)bindable;
1325             if (newValue != null)
1326             {
1327                 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.PositionZ, (float)newValue);
1328             }
1329
1330         }
1331
1332         // PositionZProperty
1333         internal static object GetInternalPositionZProperty(BindableObject bindable)
1334         {
1335             var view = (View)bindable;
1336             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.PositionZ);
1337         }
1338
1339         /// <summary>
1340         /// PositionZProperty
1341         /// </summary>
1342         [EditorBrowsable(EditorBrowsableState.Never)]
1343 #if REMOVE_READONLY
1344         internal static BindableProperty GetPositionZProperty()
1345         {
1346             if (PositionZProperty == null)
1347             {
1348                 PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float), typeof(View), default(float),
1349                     propertyChanged: SetInternalPositionZProperty, defaultValueCreator: GetInternalPositionZProperty);
1350             }
1351             return PositionZProperty;
1352         }
1353
1354         public static BindableProperty PositionZProperty = null;
1355 #else
1356         public static readonly BindableProperty PositionZProperty = null;
1357 #endif
1358         /// <summary>
1359         /// OrientationProperty
1360         /// </summary>
1361         [EditorBrowsable(EditorBrowsableState.Never)]
1362         public static readonly BindableProperty OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1363         {
1364             var view = (View)bindable;
1365             if (newValue != null)
1366             {
1367                 Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue));
1368             }
1369         }),
1370         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1371         {
1372             var view = (View)bindable;
1373             Rotation temp = new Rotation();
1374             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.ORIENTATION).Get(temp);
1375             return temp;
1376         }));
1377
1378         internal static void SetInternalScaleProperty(BindableObject bindable, object oldValue, object newValue)
1379         {
1380             var view = (View)bindable;
1381             if (newValue != null)
1382             {
1383                 view.SetScale((Vector3)newValue);
1384             }
1385
1386         }
1387
1388         // ScaleProperty
1389         internal static object GetInternalScaleProperty(BindableObject bindable)
1390         {
1391             var view = (View)bindable;
1392             if (view.internalScale == null)
1393             {
1394                 view.internalScale = new Vector3(view.OnScaleChanged, 0, 0, 0);
1395             }
1396             Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SCALE, view.internalScale.SwigCPtr);
1397             return view.internalScale;
1398         }
1399
1400         /// <summary>
1401         /// ScaleProperty
1402         /// </summary>
1403         [EditorBrowsable(EditorBrowsableState.Never)]
1404 #if REMOVE_READONLY
1405         internal static BindableProperty GetScaleProperty()
1406         {
1407             if (ScaleProperty == null)
1408             {
1409                 ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(View), null,
1410                     propertyChanged: SetInternalScaleProperty, defaultValueCreator: GetInternalScaleProperty);
1411             }
1412             return ScaleProperty;
1413         }
1414
1415         public static BindableProperty ScaleProperty = null;
1416 #else
1417         public static readonly BindableProperty ScaleProperty = null;
1418 #endif
1419
1420         // ScaleXProperty
1421         internal static void SetInternalScaleXProperty(BindableObject bindable, object oldValue, object newValue)
1422         {
1423             var view = (View)bindable;
1424             if (newValue != null)
1425             {
1426                 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleX, (float)newValue);
1427             }
1428         }
1429
1430         internal static object GetInternalScaleXProperty(BindableObject bindable)
1431         {
1432             var view = (View)bindable;
1433             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleX);
1434         }
1435
1436         /// <summary>
1437         /// ScaleXProperty
1438         /// </summary>
1439         [EditorBrowsable(EditorBrowsableState.Never)]
1440 #if REMOVE_READONLY
1441         internal static BindableProperty GetScaleXProperty()
1442         {
1443             if (ScaleXProperty == null)
1444             {
1445                 ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float), typeof(View), default(float),
1446                     propertyChanged: SetInternalScaleXProperty, defaultValueCreator: GetInternalScaleXProperty);
1447             }
1448             return ScaleXProperty;
1449         }
1450
1451         public static BindableProperty ScaleXProperty = null;
1452 #else
1453         public static readonly BindableProperty ScaleXProperty = null;
1454 #endif
1455
1456         // ScaleYProperty
1457         internal static void SetInternalScaleYProperty(BindableObject bindable, object oldValue, object newValue)
1458         {
1459             var view = (View)bindable;
1460             if (newValue != null)
1461             {
1462                 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleY, (float)newValue);
1463             }
1464         }
1465
1466         internal static object GetInternalScaleYProperty(BindableObject bindable)
1467         {
1468             var view = (View)bindable;
1469             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleY);
1470         }
1471
1472         /// <summary>
1473         /// ScaleYProperty
1474         /// </summary>
1475         [EditorBrowsable(EditorBrowsableState.Never)]
1476 #if REMOVE_READONLY
1477         internal static BindableProperty GetScaleYProperty()
1478         {
1479             if (ScaleYProperty == null)
1480             {
1481                 ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float), typeof(View), default(float),
1482                     propertyChanged: SetInternalScaleYProperty, defaultValueCreator: GetInternalScaleYProperty);
1483             }
1484             return ScaleYProperty;
1485         }
1486
1487         public static BindableProperty ScaleYProperty = null;
1488 #else
1489         public static readonly BindableProperty ScaleYProperty = null;
1490 #endif
1491
1492         // ScaleZProperty
1493         internal static void SetInternalScaleZProperty(BindableObject bindable, object oldValue, object newValue)
1494         {
1495             var view = (View)bindable;
1496             if (newValue != null)
1497             {
1498                 Object.InternalSetPropertyFloat(view.SwigCPtr, View.Property.ScaleZ, (float)newValue);
1499             }
1500         }
1501
1502         internal static object GetInternalScaleZProperty(BindableObject bindable)
1503         {
1504             var view = (View)bindable;
1505             return Object.InternalGetPropertyFloat(view.SwigCPtr, View.Property.ScaleZ);
1506         }
1507
1508         /// <summary>
1509         /// ScaleZProperty
1510         /// </summary>
1511         [EditorBrowsable(EditorBrowsableState.Never)]
1512 #if REMOVE_READONLY
1513         internal static BindableProperty GetScaleZProperty()
1514         {
1515             if (ScaleZProperty == null)
1516             {
1517                 ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float), typeof(View), default(float),
1518                     propertyChanged: SetInternalScaleZProperty, defaultValueCreator: GetInternalScaleZProperty);
1519             }
1520             return ScaleZProperty;
1521         }
1522
1523         public static BindableProperty ScaleZProperty = null;
1524 #else
1525         public static readonly BindableProperty ScaleZProperty = null;
1526 #endif
1527         
1528         // NameProperty
1529         internal static void SetInternalNameProperty(BindableObject bindable, object oldValue, object newValue)
1530         {
1531             var view = (View)bindable;
1532             if (newValue != null)
1533             {
1534                 view.internalName = (string)newValue;
1535                 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.NAME, (string)newValue);
1536             }
1537         }
1538
1539         internal static object GetInternalNameProperty(BindableObject bindable)
1540         {
1541             var view = (View)bindable;
1542             return view.internalName;
1543         }
1544
1545         /// <summary>
1546         /// NameProperty
1547         /// </summary>
1548         [EditorBrowsable(EditorBrowsableState.Never)]
1549 #if REMOVE_READONLY
1550         internal static BindableProperty GetNameProperty()
1551         {
1552             if (NameProperty == null)
1553             {
1554                 NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(View), string.Empty,
1555                     propertyChanged: SetInternalNameProperty, defaultValueCreator: GetInternalNameProperty);
1556             }
1557             return NameProperty;
1558         }
1559
1560         public static BindableProperty NameProperty = null;
1561 #else
1562         public static readonly BindableProperty NameProperty = null;
1563 #endif
1564         /// <summary>
1565         /// SensitiveProperty
1566         /// </summary>
1567         [EditorBrowsable(EditorBrowsableState.Never)]
1568         public static readonly BindableProperty SensitiveProperty = BindableProperty.Create(nameof(Sensitive), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1569         {
1570             var view = (View)bindable;
1571             if (newValue != null)
1572             {
1573                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.SENSITIVE, (bool)newValue);
1574             }
1575         }),
1576         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1577         {
1578             var view = (View)bindable;
1579             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.SENSITIVE);
1580         }));
1581
1582         /// <summary>
1583         /// IsEnabledProperty
1584         /// </summary>
1585         [EditorBrowsable(EditorBrowsableState.Never)]
1586         public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1587         {
1588             var view = (View)bindable;
1589             if (newValue != null)
1590             {
1591                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.UserInteractionEnabled, (bool)newValue);
1592                 view.OnEnabled((bool)newValue);
1593             }
1594         }),
1595         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1596         {
1597             var view = (View)bindable;
1598             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.UserInteractionEnabled);
1599         }));
1600
1601         /// <summary>
1602         /// DispatchKeyEventsProperty
1603         /// </summary>
1604         [EditorBrowsable(EditorBrowsableState.Never)]
1605         public static readonly BindableProperty DispatchKeyEventsProperty = BindableProperty.Create(nameof(DispatchKeyEvents), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1606         {
1607             var view = (View)bindable;
1608             if (newValue != null)
1609             {
1610                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.DispatchKeyEvents, (bool)newValue);
1611             }
1612         }),
1613         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1614         {
1615             var view = (View)bindable;
1616             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.DispatchKeyEvents);
1617         }));
1618
1619         /// <summary>
1620         /// LeaveRequiredProperty
1621         /// </summary>
1622         [EditorBrowsable(EditorBrowsableState.Never)]
1623         public static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create(nameof(LeaveRequired), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1624         {
1625             var view = (View)bindable;
1626             if (newValue != null)
1627             {
1628                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.LeaveRequired, (bool)newValue);
1629             }
1630         }),
1631         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1632         {
1633             var view = (View)bindable;
1634             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.LeaveRequired);
1635         }));
1636
1637         /// <summary>
1638         /// InheritOrientationProperty
1639         /// </summary>
1640         [EditorBrowsable(EditorBrowsableState.Never)]
1641         public static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create(nameof(InheritOrientation), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1642         {
1643             var view = (View)bindable;
1644             if (newValue != null)
1645             {
1646                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritOrientation, (bool)newValue);
1647             }
1648         }),
1649         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1650         {
1651             var view = (View)bindable;
1652             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritOrientation);
1653         }));
1654
1655         /// <summary>
1656         /// InheritScaleProperty
1657         /// </summary>
1658         [EditorBrowsable(EditorBrowsableState.Never)]
1659         public static readonly BindableProperty InheritScaleProperty = BindableProperty.Create(nameof(InheritScale), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1660         {
1661             var view = (View)bindable;
1662             if (newValue != null)
1663             {
1664                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritScale, (bool)newValue);
1665             }
1666         }),
1667         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1668         {
1669             var view = (View)bindable;
1670             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritScale);
1671         }));
1672
1673         /// <summary>
1674         /// DrawModeProperty
1675         /// </summary>
1676         [EditorBrowsable(EditorBrowsableState.Never)]
1677         public static readonly BindableProperty DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType), typeof(View), DrawModeType.Normal, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1678         {
1679             var view = (View)bindable;
1680             if (newValue != null)
1681             {
1682                 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.DrawMode, (int)newValue);
1683             }
1684         }),
1685         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1686         {
1687             var view = (View)bindable;
1688             return (DrawModeType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.DrawMode);
1689         }));
1690
1691         internal static void SetInternalSizeModeFactorProperty(BindableObject bindable, object oldValue, object newValue)
1692         {
1693             var view = (View)bindable;
1694             if (newValue != null)
1695             {
1696                 Object.InternalSetPropertyVector3(view.SwigCPtr, View.Property.SizeModeFactor, ((Vector3)newValue).SwigCPtr);
1697             }
1698
1699         }
1700
1701         // SizeModeFactorProperty
1702         internal static object GetInternalSizeModeFactorProperty(BindableObject bindable)
1703         {
1704             var view = (View)bindable;
1705             if (view.internalSizeModeFactor == null)
1706             {
1707                 view.internalSizeModeFactor = new Vector3(view.OnSizeModeFactorChanged, 0, 0, 0);
1708             }
1709             Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SizeModeFactor, view.internalSizeModeFactor.SwigCPtr);
1710             return view.internalSizeModeFactor;
1711         }
1712
1713         /// <summary>
1714         /// SizeModeFactorProperty
1715         /// </summary>
1716         [EditorBrowsable(EditorBrowsableState.Never)]
1717 #if REMOVE_READONLY
1718         internal static BindableProperty GetSizeModeFactorProperty()
1719         {
1720             if (SizeModeFactorProperty == null)
1721             {
1722                 SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(View), null,
1723                     propertyChanged: SetInternalSizeModeFactorProperty, defaultValueCreator: GetInternalSizeModeFactorProperty);
1724             }
1725             return SizeModeFactorProperty;
1726         }
1727
1728         public static BindableProperty SizeModeFactorProperty = null;
1729 #else
1730         public static readonly BindableProperty SizeModeFactorProperty = null;
1731 #endif
1732         /// <summary>
1733         /// WidthResizePolicyProperty
1734         /// </summary>
1735         [EditorBrowsable(EditorBrowsableState.Never)]
1736         public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1737         {
1738             var view = (View)bindable;
1739             if (newValue != null)
1740             {
1741                 if ((ResizePolicyType)newValue == ResizePolicyType.KeepSizeFollowingParent)
1742                 {
1743                     if (view.widthConstraint == null)
1744                     {
1745                         view.widthConstraint = new EqualConstraintWithParentFloat((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SizeWidth, View.Property.SizeWidth);
1746                         view.widthConstraint.Apply();
1747                     }
1748                     Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.WidthResizePolicy, (int)ResizePolicyType.FillToParent);
1749                 }
1750                 else
1751                 {
1752                     view.widthConstraint?.Remove();
1753                     view.widthConstraint?.Dispose();
1754                     view.widthConstraint = null;
1755
1756                     Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.WidthResizePolicy, (int)newValue);
1757                 }
1758                 // Match ResizePolicy to new Layouting.
1759                 // Parent relative policies can not be mapped at this point as parent size unknown.
1760                 switch ((ResizePolicyType)newValue)
1761                 {
1762                     case ResizePolicyType.UseNaturalSize:
1763                         {
1764                             view.WidthSpecification = LayoutParamPolicies.WrapContent;
1765                             break;
1766                         }
1767                     case ResizePolicyType.FillToParent:
1768                         {
1769                             view.WidthSpecification = LayoutParamPolicies.MatchParent;
1770                             break;
1771                         }
1772                     case ResizePolicyType.FitToChildren:
1773                         {
1774                             view.WidthSpecification = LayoutParamPolicies.WrapContent;
1775                             break;
1776                         }
1777                     default:
1778                         break;
1779                 }
1780             }
1781         }),
1782         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1783         {
1784             var view = (View)bindable;
1785             string temp;
1786
1787             temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.WidthResizePolicy);
1788             return temp.GetValueByDescription<ResizePolicyType>();
1789         }));
1790
1791         /// <summary>
1792         /// HeightResizePolicyProperty
1793         /// </summary>
1794         [EditorBrowsable(EditorBrowsableState.Never)]
1795         public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1796         {
1797             var view = (View)bindable;
1798             if (newValue != null)
1799             {
1800                 if ((ResizePolicyType)newValue == ResizePolicyType.KeepSizeFollowingParent)
1801                 {
1802                     if (view.heightConstraint == null)
1803                     {
1804                         view.heightConstraint = new EqualConstraintWithParentFloat((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SizeHeight, View.Property.SizeHeight);
1805                         view.heightConstraint.Apply();
1806                     }
1807
1808                     Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.HeightResizePolicy, (int)ResizePolicyType.FillToParent);
1809                 }
1810                 else
1811                 {
1812                     view.heightConstraint?.Remove();
1813                     view.heightConstraint?.Dispose();
1814                     view.heightConstraint = null;
1815
1816                     Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.HeightResizePolicy, (int)newValue);
1817                 }
1818                 // Match ResizePolicy to new Layouting.
1819                 // Parent relative policies can not be mapped at this point as parent size unknown.
1820                 switch ((ResizePolicyType)newValue)
1821                 {
1822                     case ResizePolicyType.UseNaturalSize:
1823                         {
1824                             view.HeightSpecification = LayoutParamPolicies.WrapContent;
1825                             break;
1826                         }
1827                     case ResizePolicyType.FillToParent:
1828                         {
1829                             view.HeightSpecification = LayoutParamPolicies.MatchParent;
1830                             break;
1831                         }
1832                     case ResizePolicyType.FitToChildren:
1833                         {
1834                             view.HeightSpecification = LayoutParamPolicies.WrapContent;
1835                             break;
1836                         }
1837                     default:
1838                         break;
1839                 }
1840             }
1841         }),
1842         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1843         {
1844             var view = (View)bindable;
1845             string temp;
1846
1847             temp = Object.InternalGetPropertyString(view.SwigCPtr, View.Property.HeightResizePolicy);
1848             return temp.GetValueByDescription<ResizePolicyType>();
1849         }));
1850
1851         /// <summary>
1852         /// SizeScalePolicyProperty
1853         /// </summary>
1854         [EditorBrowsable(EditorBrowsableState.Never)]
1855         public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create(nameof(SizeScalePolicy), typeof(SizeScalePolicyType), typeof(View), SizeScalePolicyType.UseSizeSet, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1856         {
1857             var view = (View)bindable;
1858             string valueToString = "";
1859             if (newValue != null)
1860             {
1861                 valueToString = ((SizeScalePolicyType)newValue).GetDescription();
1862
1863                 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.SizeScalePolicy, valueToString);
1864             }
1865         }),
1866         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1867         {
1868             var view = (View)bindable;
1869
1870             return (SizeScalePolicyType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.SizeScalePolicy);
1871         }));
1872
1873         /// <summary>
1874         /// WidthForHeightProperty
1875         /// </summary>
1876         [EditorBrowsable(EditorBrowsableState.Never)]
1877         public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1878         {
1879             var view = (View)bindable;
1880             if (newValue != null)
1881             {
1882                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.WidthForHeight, (bool)newValue);
1883             }
1884         }),
1885         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1886         {
1887             var view = (View)bindable;
1888
1889             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.WidthForHeight);
1890         }));
1891
1892         /// <summary>
1893         /// HeightForWidthProperty
1894         /// </summary>
1895         [EditorBrowsable(EditorBrowsableState.Never)]
1896         public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
1897         {
1898             var view = (View)bindable;
1899             if (newValue != null)
1900             {
1901
1902                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.HeightForWidth, (bool)newValue);
1903             }
1904         }),
1905         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
1906         {
1907             var view = (View)bindable;
1908
1909             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.HeightForWidth);
1910         }));
1911
1912         // PaddingProperty
1913         internal static void SetInternalPaddingProperty(BindableObject bindable, object oldValue, object newValue)
1914         {
1915             var view = (View)bindable;
1916             if (newValue != null)
1917             {
1918                 if (view.Layout != null)
1919                 {
1920                     view.Layout.Padding = new Extents((Extents)newValue);
1921                     if ((view.Padding.Start != 0) || (view.Padding.End != 0) || (view.Padding.Top != 0) || (view.Padding.Bottom != 0))
1922                     {
1923                         var tmp = new PropertyValue(new Extents(0, 0, 0, 0));
1924                         Object.SetProperty(view.SwigCPtr, Property.PADDING, tmp);
1925                         tmp?.Dispose();
1926                     }
1927                     view.Layout.RequestLayout();
1928                 }
1929                 else
1930                 {
1931                     var tmp = new PropertyValue((Extents)newValue);
1932                     Object.SetProperty(view.SwigCPtr, Property.PADDING, tmp);
1933                     tmp?.Dispose();
1934                 }
1935             }
1936         }
1937
1938         internal static object GetInternalPaddingProperty(BindableObject bindable)
1939         {
1940             var view = (View)bindable;
1941             if ((view.internalPadding == null) || (view.Layout != null))
1942             {
1943                 ushort start = 0, end = 0, top = 0, bottom = 0;
1944                 if (view.Layout != null)
1945                 {
1946                     if (view.Layout.Padding != null)
1947                     {
1948                         start = view.Layout.Padding.Start;
1949                         end = view.Layout.Padding.End;
1950                         top = view.Layout.Padding.Top;
1951                         bottom = view.Layout.Padding.Bottom;
1952                     }
1953                 }
1954                 view.internalPadding = new Extents(view.OnPaddingChanged, start, end, top, bottom);
1955             }
1956
1957             if (view.Layout == null)
1958             {
1959                 var tmp = Object.GetProperty(view.SwigCPtr, Property.PADDING);
1960                 tmp?.Get(view.internalPadding);
1961                 tmp?.Dispose();
1962             }
1963
1964             return view.internalPadding;
1965         }
1966
1967         /// <summary>
1968         /// PaddingProperty
1969         /// </summary>
1970         [EditorBrowsable(EditorBrowsableState.Never)]
1971 #if REMOVE_READONLY
1972         internal static BindableProperty GetPaddingProperty()
1973         {
1974             if (PaddingProperty == null)
1975             {
1976                 PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(View), null,
1977                     propertyChanged: SetInternalPaddingProperty, defaultValueCreator: GetInternalPaddingProperty);
1978             }
1979             return PaddingProperty;
1980         }
1981
1982         public static BindableProperty PaddingProperty = null;
1983 #else
1984         public static readonly BindableProperty PaddingProperty = null;
1985 #endif
1986
1987         // SizeProperty
1988         internal static void SetInternalSizeProperty(BindableObject bindable, object oldValue, object newValue)
1989         {
1990             var view = (View)bindable;
1991             if (newValue != null)
1992             {
1993                 // Size property setter is only used by user.
1994                 // Framework code uses SetSize() instead of Size property setter.
1995                 // Size set by user is returned by GetUserSize2D() for SuggestedMinimumWidth/Height.
1996                 // SuggestedMinimumWidth/Height is used by Layout calculation.
1997                 float width = ((Size)newValue).Width;
1998                 float height = ((Size)newValue).Height;
1999                 float depth = ((Size)newValue).Depth;
2000
2001                 view.userSizeWidth = width;
2002                 view.userSizeHeight = height;
2003
2004                 // Set Specification so when layouts measure this View it matches the value set here.
2005                 // All Views are currently Layouts.
2006                 int widthPolicy = (int)System.Math.Ceiling(width);
2007                 int heightPolicy = (int)System.Math.Ceiling(height);
2008
2009                 bool relayoutRequired = false;
2010                 // To avoid duplicated size setup, change internal policy directly.
2011                 if (view.widthPolicy != widthPolicy)
2012                 {
2013                     view.widthPolicy = widthPolicy;
2014                     relayoutRequired = true;
2015                 }
2016                 if (view.heightPolicy != heightPolicy)
2017                 {
2018                     view.heightPolicy = heightPolicy;
2019                     relayoutRequired = true;
2020                 }
2021                 if (relayoutRequired)
2022                 {
2023                     view.layout?.RequestLayout();
2024                 }
2025
2026                 view.SetSize(width, height, depth);
2027             }
2028         }
2029
2030         internal static object GetInternalSizeProperty(BindableObject bindable)
2031         {
2032             var view = (View)bindable;
2033
2034             if (view.internalSize == null)
2035             {
2036                 view.internalSize = new Size(view.OnSizeChanged, 0, 0, 0);
2037             }
2038             Object.InternalRetrievingPropertyVector3(view.SwigCPtr, View.Property.SIZE, view.internalSize.SwigCPtr);
2039
2040             return view.internalSize;
2041         }
2042
2043         /// <summary>
2044         /// SizeProperty
2045         /// </summary>
2046         [EditorBrowsable(EditorBrowsableState.Never)]
2047 #if REMOVE_READONLY
2048         internal static BindableProperty GetSizeProperty()
2049         {
2050             if (SizeProperty == null)
2051             {
2052                 SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(View), null,
2053                     propertyChanged: SetInternalSizeProperty, defaultValueCreator: GetInternalSizeProperty);
2054             }
2055             return SizeProperty;
2056         }
2057
2058         public static BindableProperty SizeProperty = null;
2059 #else
2060         public static readonly BindableProperty SizeProperty = null;
2061 #endif
2062
2063         // MinimumSizeProperty
2064         internal static void SetInternalMinimumSizeProperty(BindableObject bindable, object oldValue, object newValue)
2065         {
2066             var view = (View)bindable;
2067             if (newValue != null)
2068             {
2069
2070                 Object.InternalSetPropertyVector2(view.SwigCPtr, View.Property.MinimumSize, ((Size2D)newValue).SwigCPtr);
2071             }
2072         }
2073
2074         internal static object GetInternalMinimumSizeProperty(BindableObject bindable)
2075         {
2076
2077             var view = (View)bindable;
2078             if (view.internalMinimumSize == null)
2079             {
2080                 view.internalMinimumSize = new Size2D(view.OnMinimumSizeChanged, 0, 0);
2081             }
2082             Object.InternalRetrievingPropertyVector2(view.SwigCPtr, View.Property.MinimumSize, view.internalMinimumSize.SwigCPtr);
2083             return view.internalMinimumSize;
2084         }
2085
2086         /// <summary>
2087         /// MinimumSizeProperty
2088         /// </summary>
2089         [EditorBrowsable(EditorBrowsableState.Never)]
2090 #if REMOVE_READONLY
2091         internal static BindableProperty GetMinimumSizeProperty()
2092         {
2093             if (MinimumSizeProperty == null)
2094             {
2095                 MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(View), null,
2096                     propertyChanged: SetInternalMinimumSizeProperty, defaultValueCreator: GetInternalMinimumSizeProperty);
2097             }
2098             return MinimumSizeProperty;
2099         }
2100
2101         public static BindableProperty MinimumSizeProperty = null;
2102 #else
2103         public static readonly BindableProperty MinimumSizeProperty = null;
2104 #endif
2105
2106         // MaximumSizeProperty
2107         internal static void SetInternalMaximumSizeProperty(BindableObject bindable, object oldValue, object newValue)
2108         {
2109             var view = (View)bindable;
2110             if (newValue != null)
2111             {
2112
2113                 Object.InternalSetPropertyVector2(view.SwigCPtr, View.Property.MaximumSize, ((Size2D)newValue).SwigCPtr);
2114             }
2115         }
2116
2117         internal static object GetInternalMaximumSizeProperty(BindableObject bindable)
2118         {
2119             var view = (View)bindable;
2120
2121             if (view.internalMaximumSize == null)
2122             {
2123                 view.internalMaximumSize = new Size2D(view.OnMaximumSizeChanged, 0, 0);
2124             }
2125             Object.InternalRetrievingPropertyVector2(view.SwigCPtr, View.Property.MaximumSize, view.internalMaximumSize.SwigCPtr);
2126             return view.internalMaximumSize;
2127         }
2128
2129         /// <summary>
2130         /// MaximumSizeProperty
2131         /// </summary>
2132         [EditorBrowsable(EditorBrowsableState.Never)]
2133 #if REMOVE_READONLY
2134         internal static BindableProperty GetMaximumSizeProperty()
2135         {
2136             if (MaximumSizeProperty == null)
2137             {
2138                 MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(View), null,
2139                     propertyChanged: SetInternalMaximumSizeProperty, defaultValueCreator: GetInternalMaximumSizeProperty);
2140             }
2141             return MaximumSizeProperty;
2142         }
2143
2144         public static BindableProperty MaximumSizeProperty = null;
2145 #else
2146         public static readonly BindableProperty MaximumSizeProperty = null;
2147 #endif
2148
2149         /// <summary>
2150         /// InheritPositionProperty
2151         /// </summary>
2152         [EditorBrowsable(EditorBrowsableState.Never)]
2153         public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create(nameof(InheritPosition), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2154         {
2155             var view = (View)bindable;
2156             if (newValue != null)
2157             {
2158                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritPosition, (bool)newValue);
2159             }
2160         }),
2161         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2162         {
2163             var view = (View)bindable;
2164
2165             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritPosition);
2166         }));
2167
2168         /// <summary>
2169         /// ClippingModeProperty
2170         /// </summary>
2171         [EditorBrowsable(EditorBrowsableState.Never)]
2172         public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType), typeof(View), ClippingModeType.Disabled, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2173         {
2174             var view = (View)bindable;
2175             if (newValue != null)
2176             {
2177
2178                 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.ClippingMode, (int)newValue);
2179             }
2180         }),
2181         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2182         {
2183             var view = (View)bindable;
2184
2185             return (ClippingModeType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.ClippingMode);
2186         }));
2187
2188         /// <summary>
2189         /// InheritLayoutDirectionProperty
2190         /// </summary>
2191         [EditorBrowsable(EditorBrowsableState.Never)]
2192         public static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create(nameof(InheritLayoutDirection), typeof(bool), typeof(View), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2193         {
2194             var view = (View)bindable;
2195             if (newValue != null)
2196             {
2197
2198                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.InheritLayoutDirection, (bool)newValue);
2199             }
2200         }),
2201         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2202         {
2203             var view = (View)bindable;
2204
2205             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.InheritLayoutDirection);
2206         }));
2207
2208         /// <summary>
2209         /// LayoutDirectionProperty
2210         /// </summary>
2211         [EditorBrowsable(EditorBrowsableState.Never)]
2212         public static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create(nameof(LayoutDirection), typeof(ViewLayoutDirectionType), typeof(View), ViewLayoutDirectionType.LTR, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2213         {
2214             var view = (View)bindable;
2215             if (newValue != null)
2216             {
2217
2218                 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.LayoutDirection, (int)newValue);
2219             }
2220         }),
2221         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2222         {
2223             var view = (View)bindable;
2224
2225             return (ViewLayoutDirectionType)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.LayoutDirection);
2226         }));
2227
2228         // MarginProperty
2229         internal static void SetInternalMarginProperty(BindableObject bindable, object oldValue, object newValue)
2230         {
2231             var view = (View)bindable;
2232             if (newValue != null)
2233             {
2234                 if (view.Layout != null)
2235                 {
2236                     view.Layout.Margin = new Extents((Extents)newValue);
2237                     if ((view.Margin.Start != 0) || (view.Margin.End != 0) || (view.Margin.Top != 0) || (view.Margin.Bottom != 0))
2238                     {
2239                         var tmp = new PropertyValue(new Extents(0, 0, 0, 0));
2240                         Object.SetProperty(view.SwigCPtr, Property.MARGIN, tmp);
2241                         tmp?.Dispose();
2242                     }
2243                     view.Layout.RequestLayout();
2244                 }
2245                 else
2246                 {
2247                     var tmp = new PropertyValue((Extents)newValue);
2248                     Object.SetProperty(view.SwigCPtr, Property.MARGIN, tmp);
2249                     tmp?.Dispose();
2250                 }
2251             }
2252         }
2253
2254         internal static object GetInternalMarginProperty(BindableObject bindable)
2255         {
2256             var view = (View)bindable;
2257             if ((view.internalMargin == null) || (view.Layout != null))
2258             {
2259                 ushort start = 0, end = 0, top = 0, bottom = 0;
2260                 if (view.Layout != null)
2261                 {
2262                     if (view.Layout.Margin != null)
2263                     {
2264                         start = view.Layout.Margin.Start;
2265                         end = view.Layout.Margin.End;
2266                         top = view.Layout.Margin.Top;
2267                         bottom = view.Layout.Margin.Bottom;
2268                     }
2269                 }
2270                 view.internalMargin = new Extents(view.OnMarginChanged, start, end, top, bottom);
2271             }
2272
2273             if (view.Layout == null)
2274             {
2275
2276                 var tmp = Object.GetProperty(view.SwigCPtr, Property.MARGIN);
2277                 tmp?.Get(view.internalMargin);
2278                 tmp?.Dispose();
2279             }
2280
2281             return view.internalMargin;
2282         }
2283
2284         /// <summary>
2285         /// MarginProperty
2286         /// </summary>
2287         [EditorBrowsable(EditorBrowsableState.Never)]
2288 #if REMOVE_READONLY
2289         internal static BindableProperty GetMarginProperty()
2290         {
2291             if (MarginProperty == null)
2292             {
2293                 MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(View), null,
2294                     propertyChanged: SetInternalMarginProperty, defaultValueCreator: GetInternalMarginProperty);
2295             }
2296             return MarginProperty;
2297         }
2298
2299         public static BindableProperty MarginProperty = null;
2300 #else
2301         public static readonly BindableProperty MarginProperty = null;
2302 #endif
2303
2304         /// <summary>
2305         /// UpdateAreaHintProperty
2306         /// </summary>
2307         [EditorBrowsable(EditorBrowsableState.Never)]
2308         public static readonly BindableProperty UpdateAreaHintProperty = BindableProperty.Create(nameof(UpdateAreaHint), typeof(Vector4), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2309         {
2310             var view = (View)bindable;
2311             if (newValue != null)
2312             {
2313
2314                 Object.InternalSetPropertyVector4(view.SwigCPtr, Interop.ActorProperty.UpdateAreaHintGet(), ((Vector4)newValue).SwigCPtr);
2315             }
2316         }),
2317         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2318         {
2319             var view = (View)bindable;
2320             Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2321
2322             Object.InternalRetrievingPropertyVector4(view.SwigCPtr, Interop.ActorProperty.UpdateAreaHintGet(), temp.SwigCPtr);
2323             return temp;
2324         }));
2325
2326         /// <summary>
2327         /// ImageShadow Property
2328         /// </summary>
2329         [EditorBrowsable(EditorBrowsableState.Never)]
2330         public static readonly BindableProperty ImageShadowProperty = BindableProperty.Create(nameof(ImageShadow), typeof(ImageShadow), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2331         {
2332             var view = (View)bindable;
2333
2334             view.themeData?.selectorData?.ClearShadow(view);
2335
2336             if (newValue is Selector<ImageShadow> selector)
2337             {
2338                 if (selector.HasAll()) view.SetShadow(selector.All);
2339                 else view.EnsureSelectorData().ImageShadow = new TriggerableSelector<ImageShadow>(view, selector, view.SetShadow, true);
2340             }
2341             else
2342             {
2343                 view.SetShadow((ImageShadow)newValue);
2344             }
2345         }),
2346         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2347         {
2348             var view = (View)bindable;
2349
2350             // Sync as current properties
2351             view.UpdateBackgroundExtraData();
2352
2353             PropertyMap map = new PropertyMap();
2354             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SHADOW).Get(map);
2355
2356             var shadow = new ImageShadow(map);
2357             return shadow.IsEmpty() ? null : shadow;
2358         }));
2359
2360         /// <summary>
2361         /// Shadow Property
2362         /// </summary>
2363         [EditorBrowsable(EditorBrowsableState.Never)]
2364         public static readonly BindableProperty BoxShadowProperty = BindableProperty.Create(nameof(BoxShadow), typeof(Shadow), typeof(View), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
2365         {
2366             var view = (View)bindable;
2367
2368             view.themeData?.selectorData?.ClearShadow(view);
2369
2370             if (newValue is Selector<Shadow> selector)
2371             {
2372                 if (selector.HasAll()) view.SetShadow(selector.All);
2373                 else view.EnsureSelectorData().BoxShadow = new TriggerableSelector<Shadow>(view, selector, view.SetShadow, true);
2374             }
2375             else
2376             {
2377                 view.SetShadow((Shadow)newValue);
2378             }
2379         }),
2380         defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
2381         {
2382             var view = (View)bindable;
2383
2384             // Sync as current properties
2385             view.UpdateBackgroundExtraData();
2386
2387             PropertyMap map = new PropertyMap();
2388             Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SHADOW).Get(map);
2389
2390             var shadow = new Shadow(map);
2391             return shadow.IsEmpty() ? null : shadow;
2392         }));
2393
2394         /// <summary>
2395         /// CornerRadius Property
2396         /// </summary>
2397         [EditorBrowsable(EditorBrowsableState.Never)]
2398         public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(Vector4), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2399         {
2400             var view = (View)bindable;
2401             (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).CornerRadius = (Vector4)newValue;
2402             view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius);
2403         },
2404         defaultValueCreator: (bindable) =>
2405         {
2406             var view = (View)bindable;
2407             return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.CornerRadius;
2408         });
2409
2410         /// <summary>
2411         /// CornerRadiusPolicy Property
2412         /// </summary>
2413         [EditorBrowsable(EditorBrowsableState.Never)]
2414         public static readonly BindableProperty CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType), typeof(View), VisualTransformPolicyType.Absolute, propertyChanged: (bindable, oldValue, newValue) =>
2415         {
2416             var view = (View)bindable;
2417             (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).CornerRadiusPolicy = (VisualTransformPolicyType)newValue;
2418
2419             if (view.backgroundExtraData.CornerRadius != null)
2420             {
2421                 view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.CornerRadius);
2422             }
2423         },
2424         defaultValueCreator: (bindable) =>
2425         {
2426             var view = (View)bindable;
2427             return view.backgroundExtraData == null ? VisualTransformPolicyType.Absolute : view.backgroundExtraData.CornerRadiusPolicy;
2428         });
2429
2430         /// <summary>
2431         /// BorderlineWidth Property
2432         /// </summary>
2433         [EditorBrowsable(EditorBrowsableState.Never)]
2434         public static readonly BindableProperty BorderlineWidthProperty = BindableProperty.Create(nameof(BorderlineWidth), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
2435         {
2436             var view = (View)bindable;
2437             (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineWidth = (float)newValue;
2438             view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline);
2439         },
2440         defaultValueCreator: (bindable) =>
2441         {
2442             var view = (View)bindable;
2443             return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.BorderlineWidth;
2444         });
2445
2446         /// <summary>
2447         /// BorderlineColor Property
2448         /// </summary>
2449         [EditorBrowsable(EditorBrowsableState.Never)]
2450         public static readonly BindableProperty BorderlineColorProperty = BindableProperty.Create(nameof(BorderlineColor), typeof(Color), typeof(View), null,
2451             propertyChanged: (bindable, oldValue, newValue) =>
2452             {
2453                 var view = (View)bindable;
2454
2455                 view.themeData?.selectorData?.BorderlineColor?.Reset(view);
2456
2457                 if (newValue is Selector<Color> selector)
2458                 {
2459                     if (selector.HasAll()) view.SetBorderlineColor(selector.All);
2460                     else view.EnsureSelectorData().BorderlineColor = new TriggerableSelector<Color>(view, selector, view.SetBorderlineColor, true);
2461                 }
2462                 else
2463                 {
2464                     view.SetBorderlineColor((Color)newValue);
2465                 }
2466             },
2467             defaultValueCreator: (bindable) =>
2468             {
2469                 var view = (View)bindable;
2470                 return view.backgroundExtraData == null ? Color.Black : view.backgroundExtraData.BorderlineColor;
2471             }
2472         );
2473
2474         /// <summary>
2475         /// BorderlineColorSelector Property
2476         /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
2477         /// So this API is internally used only.
2478         /// </summary>
2479         internal static readonly BindableProperty BorderlineColorSelectorProperty = BindableProperty.Create(nameof(BorderlineColorSelector), typeof(Selector<Color>), typeof(View), null,
2480             propertyChanged: (bindable, oldValue, newValue) =>
2481             {
2482                 var view = (View)bindable;
2483
2484                 view.themeData?.selectorData?.BorderlineColor?.Reset(view);
2485
2486                 if (newValue is Selector<Color> selector)
2487                 {
2488                     if (selector.HasAll()) view.SetBorderlineColor(selector.All);
2489                     else view.EnsureSelectorData().BorderlineColor = new TriggerableSelector<Color>(view, selector, view.SetBorderlineColor, true);
2490                 }
2491                 else
2492                 {
2493                     view.SetBorderlineColor((Color)newValue);
2494                 }
2495             },
2496             defaultValueCreator: (bindable) =>
2497             {
2498                 var view = (View)bindable;
2499                 var selector = view.themeData?.selectorData?.BorderlineColor?.Get();
2500                 return (null != selector) ? selector : new Selector<Color>();
2501             }
2502         );
2503
2504         /// <summary>
2505         /// BorderlineOffset Property
2506         /// </summary>
2507         [EditorBrowsable(EditorBrowsableState.Never)]
2508         public static readonly BindableProperty BorderlineOffsetProperty = BindableProperty.Create(nameof(BorderlineOffset), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
2509         {
2510             var view = (View)bindable;
2511             (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineOffset = (float)newValue;
2512             view.UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline);
2513         },
2514         defaultValueCreator: (bindable) =>
2515         {
2516             var view = (View)bindable;
2517             return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.BorderlineOffset;
2518         });
2519
2520         /// <summary>
2521         /// EnableControlState property
2522         /// </summary>
2523         [EditorBrowsable(EditorBrowsableState.Never)]
2524         public static readonly BindableProperty EnableControlStateProperty = BindableProperty.Create(nameof(EnableControlState), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2525         {
2526             var view = (View)bindable;
2527             bool prev = view.enableControlState;
2528             view.enableControlState = (bool)newValue;
2529
2530             if (prev != view.enableControlState)
2531             {
2532                 if (prev)
2533                 {
2534                     view.TouchEvent -= view.EmptyOnTouch;
2535                 }
2536                 else
2537                 {
2538                     view.TouchEvent += view.EmptyOnTouch;
2539                 }
2540             }
2541         },
2542         defaultValueCreator: (bindable) =>
2543         {
2544             return ((View)bindable).enableControlState;
2545         });
2546
2547         /// <summary>
2548         /// ThemeChangeSensitive property
2549         /// </summary>
2550         [EditorBrowsable(EditorBrowsableState.Never)]
2551         public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2552         {
2553             var view = (View)bindable;
2554
2555             if (view.ThemeChangeSensitive == (bool)newValue) return;
2556
2557             if (view.themeData == null) view.themeData = new ThemeData();
2558
2559             view.themeData.ThemeChangeSensitive = (bool)newValue;
2560
2561             if (view.themeData.ThemeChangeSensitive && !view.themeData.ListeningThemeChangeEvent)
2562             {
2563                 view.themeData.ListeningThemeChangeEvent = true;
2564                 ThemeManager.ThemeChangedInternal.Add(view.OnThemeChanged);
2565             }
2566             else if (!view.themeData.ThemeChangeSensitive && view.themeData.ListeningThemeChangeEvent)
2567             {
2568                 view.themeData.ListeningThemeChangeEvent = false;
2569                 ThemeManager.ThemeChangedInternal.Remove(view.OnThemeChanged);
2570             }
2571         },
2572         defaultValueCreator: (bindable) =>
2573         {
2574             return ((View)bindable).themeData?.ThemeChangeSensitive ?? ThemeManager.ApplicationThemeChangeSensitive;
2575         });
2576
2577         /// <summary>
2578         /// AccessibilityNameProperty
2579         /// </summary>
2580         [EditorBrowsable(EditorBrowsableState.Never)]
2581         public static readonly BindableProperty AccessibilityNameProperty = BindableProperty.Create(nameof(AccessibilityName), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
2582         {
2583             var view = (View)bindable;
2584             if (newValue != null)
2585             {
2586
2587                 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityName, (string)newValue);
2588             }
2589         },
2590         defaultValueCreator: (bindable) =>
2591         {
2592             var view = (View)bindable;
2593
2594             return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityName);
2595         });
2596
2597         /// <summary>
2598         /// AccessibilityDescriptionProperty
2599         /// </summary>
2600         [EditorBrowsable(EditorBrowsableState.Never)]
2601         public static readonly BindableProperty AccessibilityDescriptionProperty = BindableProperty.Create(nameof(AccessibilityDescription), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
2602         {
2603             var view = (View)bindable;
2604             if (newValue != null)
2605             {
2606
2607                 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityDescription, (string)newValue);
2608             }
2609         },
2610         defaultValueCreator: (bindable) =>
2611         {
2612             var view = (View)bindable;
2613
2614             return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityDescription);
2615         });
2616
2617         /// <summary>
2618         /// AccessibilityTranslationDomainProperty
2619         /// </summary>
2620         [EditorBrowsable(EditorBrowsableState.Never)]
2621         public static readonly BindableProperty AccessibilityTranslationDomainProperty = BindableProperty.Create(nameof(AccessibilityTranslationDomain), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
2622         {
2623             var view = (View)bindable;
2624             if (newValue != null)
2625             {
2626
2627                 Object.InternalSetPropertyString(view.SwigCPtr, View.Property.AccessibilityTranslationDomain, (string)newValue);
2628             }
2629         },
2630         defaultValueCreator: (bindable) =>
2631         {
2632             var view = (View)bindable;
2633
2634             return Object.InternalGetPropertyString(view.SwigCPtr, View.Property.AccessibilityTranslationDomain);
2635         });
2636
2637         /// <summary>
2638         /// AccessibilityRoleProperty
2639         /// </summary>
2640         [EditorBrowsable(EditorBrowsableState.Never)]
2641         public static readonly BindableProperty AccessibilityRoleProperty = BindableProperty.Create(nameof(AccessibilityRole), typeof(Role), typeof(View), default(Role), propertyChanged: (bindable, oldValue, newValue) =>
2642         {
2643             var view = (View)bindable;
2644             if (newValue != null)
2645             {
2646
2647                 Object.InternalSetPropertyInt(view.SwigCPtr, View.Property.AccessibilityRole, (int)newValue);
2648             }
2649         },
2650         defaultValueCreator: (bindable) =>
2651         {
2652             var view = (View)bindable;
2653
2654             return (Role)Object.InternalGetPropertyInt(view.SwigCPtr, View.Property.AccessibilityRole);
2655         });
2656
2657         /// <summary>
2658         /// AccessibilityHighlightableProperty
2659         /// </summary>
2660         [EditorBrowsable(EditorBrowsableState.Never)]
2661         public static readonly BindableProperty AccessibilityHighlightableProperty = BindableProperty.Create(nameof(AccessibilityHighlightable), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2662         {
2663             var view = (View)bindable;
2664             if (newValue != null)
2665             {
2666
2667                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHighlightable, (bool)newValue);
2668             }
2669         },
2670         defaultValueCreator: (bindable) =>
2671         {
2672             var view = (View)bindable;
2673
2674             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHighlightable);
2675         });
2676
2677         /// <summary>
2678         /// AccessibilityHiddenProperty
2679         /// </summary>
2680         [EditorBrowsable(EditorBrowsableState.Never)]
2681         public static readonly BindableProperty AccessibilityHiddenProperty = BindableProperty.Create(nameof(AccessibilityHidden), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2682         {
2683             var view = (View)bindable;
2684             if (newValue != null)
2685             {
2686
2687                 Object.InternalSetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHidden, (bool)newValue);
2688             }
2689         },
2690         defaultValueCreator: (bindable) =>
2691         {
2692             var view = (View)bindable;
2693
2694             return Object.InternalGetPropertyBool(view.SwigCPtr, View.Property.AccessibilityHidden);
2695         });
2696
2697         /// <summary>
2698         /// ExcludeLayoutingProperty
2699         /// </summary>
2700         [EditorBrowsable(EditorBrowsableState.Never)]
2701         public static readonly BindableProperty ExcludeLayoutingProperty = BindableProperty.Create(nameof(ExcludeLayouting), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2702         {
2703             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2704             if (newValue != null)
2705             {
2706                 instance.InternalExcludeLayouting = (bool)newValue;
2707             }
2708         },
2709         defaultValueCreator: (bindable) =>
2710         {
2711             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2712             return instance.InternalExcludeLayouting;
2713         });
2714
2715         /// <summary>
2716         /// TooltipTextProperty
2717         /// </summary>
2718         [EditorBrowsable(EditorBrowsableState.Never)]
2719         public static readonly BindableProperty TooltipTextProperty = BindableProperty.Create(nameof(TooltipText), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
2720         {
2721             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2722             if (newValue != null)
2723             {
2724                 instance.InternalTooltipText = (string)newValue;
2725             }
2726         },
2727         defaultValueCreator: (bindable) =>
2728         {
2729             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2730             return instance.InternalTooltipText;
2731         });
2732
2733         /// <summary>
2734         /// PositionUsesAnchorPointProperty
2735         /// </summary>
2736         [EditorBrowsable(EditorBrowsableState.Never)]
2737         public static readonly BindableProperty PositionUsesAnchorPointProperty = BindableProperty.Create(nameof(PositionUsesAnchorPoint), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2738         {
2739             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2740             if (newValue != null)
2741             {
2742                 instance.InternalPositionUsesAnchorPoint = (bool)newValue;
2743             }
2744         },
2745         defaultValueCreator: (bindable) =>
2746         {
2747             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2748             return instance.InternalPositionUsesAnchorPoint;
2749         });
2750
2751         // AnchorPointProperty
2752         internal static void SetInternalAnchorPointProperty(BindableObject bindable, object oldValue, object newValue)
2753         {
2754             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2755             if (newValue != null)
2756             {
2757                 instance.InternalAnchorPoint = (Tizen.NUI.Position)newValue;
2758             }
2759         }
2760
2761         internal static object GetInternalAnchorPointProperty(BindableObject bindable)
2762         {
2763             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2764             return instance.InternalAnchorPoint;
2765         }
2766
2767         /// <summary>
2768         /// AnchorPointProperty
2769         /// </summary>
2770         [EditorBrowsable(EditorBrowsableState.Never)]
2771 #if REMOVE_READONLY
2772         internal static BindableProperty GetAnchorPointProperty()
2773         {
2774             if (AnchorPointProperty == null)
2775             {
2776                 AnchorPointProperty = BindableProperty.Create(nameof(AnchorPoint), typeof(Tizen.NUI.Position), typeof(View), null,
2777                     propertyChanged: SetInternalAnchorPointProperty, defaultValueCreator: GetInternalAnchorPointProperty);
2778             }
2779             return AnchorPointProperty;
2780         }
2781
2782         public static BindableProperty AnchorPointProperty = null;
2783 #else
2784         public static readonly BindableProperty AnchorPointProperty = null;
2785 #endif
2786
2787         /// <summary>
2788         /// WidthSpecificationProperty
2789         /// </summary>
2790         [EditorBrowsable(EditorBrowsableState.Never)]
2791         public static readonly BindableProperty WidthSpecificationProperty = BindableProperty.Create(nameof(WidthSpecification), typeof(int), typeof(View), 0, propertyChanged: (bindable, oldValue, newValue) =>
2792         {
2793             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2794             if (newValue != null)
2795             {
2796                 instance.InternalWidthSpecification = (int)newValue;
2797             }
2798         },
2799         defaultValueCreator: (bindable) =>
2800         {
2801             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2802             return instance.InternalWidthSpecification;
2803         });
2804
2805         /// <summary>
2806         /// HeightSpecificationProperty
2807         /// </summary>
2808         [EditorBrowsable(EditorBrowsableState.Never)]
2809         public static readonly BindableProperty HeightSpecificationProperty = BindableProperty.Create(nameof(HeightSpecification), typeof(int), typeof(View), 0, propertyChanged: (bindable, oldValue, newValue) =>
2810         {
2811             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2812             if (newValue != null)
2813             {
2814                 instance.InternalHeightSpecification = (int)newValue;
2815             }
2816         },
2817         defaultValueCreator: (bindable) =>
2818         {
2819             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2820             return instance.InternalHeightSpecification;
2821         });
2822
2823         /// <summary>
2824         /// LayoutTransitionProperty
2825         /// </summary>
2826         [EditorBrowsable(EditorBrowsableState.Never)]
2827         public static readonly BindableProperty LayoutTransitionProperty = BindableProperty.Create(nameof(LayoutTransition), typeof(Tizen.NUI.LayoutTransition), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2828         {
2829             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2830             if (newValue != null)
2831             {
2832                 instance.InternalLayoutTransition = (Tizen.NUI.LayoutTransition)newValue;
2833             }
2834         },
2835         defaultValueCreator: (bindable) =>
2836         {
2837             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2838             return instance.InternalLayoutTransition;
2839         });
2840
2841         /// <summary>
2842         /// PaddingEXProperty
2843         /// </summary>
2844         [EditorBrowsable(EditorBrowsableState.Never)]
2845         public static readonly BindableProperty PaddingEXProperty = BindableProperty.Create(nameof(PaddingEX), typeof(Tizen.NUI.Extents), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2846         {
2847             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2848             if (newValue != null)
2849             {
2850                 instance.InternalPaddingEX = (Tizen.NUI.Extents)newValue;
2851             }
2852         },
2853         defaultValueCreator: (bindable) =>
2854         {
2855             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2856             return instance.InternalPaddingEX;
2857         });
2858
2859         /// <summary>
2860         /// LayoutProperty
2861         /// </summary>
2862         [EditorBrowsable(EditorBrowsableState.Never)]
2863         public static readonly BindableProperty LayoutProperty = BindableProperty.Create(nameof(Layout), typeof(Tizen.NUI.LayoutItem), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2864         {
2865             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2866             if (newValue != null)
2867             {
2868                 instance.InternalLayout = (Tizen.NUI.LayoutItem)newValue;
2869             }
2870         },
2871         defaultValueCreator: (bindable) =>
2872         {
2873             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2874             return instance.InternalLayout;
2875         });
2876
2877         /// <summary>
2878         /// BackgroundImageSynchronosLoadingProperty
2879         /// </summary>
2880         [EditorBrowsable(EditorBrowsableState.Never)]
2881         public static readonly BindableProperty BackgroundImageSynchronosLoadingProperty = BindableProperty.Create(nameof(BackgroundImageSynchronosLoading), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2882         {
2883             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2884             if (newValue != null)
2885             {
2886                 instance.InternalBackgroundImageSynchronosLoading = (bool)newValue;
2887             }
2888         },
2889         defaultValueCreator: (bindable) =>
2890         {
2891             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2892             return instance.InternalBackgroundImageSynchronosLoading;
2893         });
2894
2895         /// <summary>
2896         /// BackgroundImageSynchronousLoadingProperty
2897         /// </summary>
2898         [EditorBrowsable(EditorBrowsableState.Never)]
2899         public static readonly BindableProperty BackgroundImageSynchronousLoadingProperty = BindableProperty.Create(nameof(BackgroundImageSynchronousLoading), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2900         {
2901             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2902             if (newValue != null)
2903             {
2904                 instance.InternalBackgroundImageSynchronousLoading = (bool)newValue;
2905             }
2906         },
2907         defaultValueCreator: (bindable) =>
2908         {
2909             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2910             return instance.InternalBackgroundImageSynchronousLoading;
2911         });
2912
2913         /// <summary>
2914         /// EnableControlStatePropagationProperty
2915         /// </summary>
2916         [EditorBrowsable(EditorBrowsableState.Never)]
2917         public static readonly BindableProperty EnableControlStatePropagationProperty = BindableProperty.Create(nameof(EnableControlStatePropagation), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2918         {
2919             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2920             if (newValue != null)
2921             {
2922                 instance.InternalEnableControlStatePropagation = (bool)newValue;
2923             }
2924         },
2925         defaultValueCreator: (bindable) =>
2926         {
2927             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2928             return instance.InternalEnableControlStatePropagation;
2929         });
2930
2931         /// <summary>
2932         /// PropagatableControlStatesProperty
2933         /// </summary>
2934         [EditorBrowsable(EditorBrowsableState.Never)]
2935         public static readonly BindableProperty PropagatableControlStatesProperty = BindableProperty.Create(nameof(PropagatableControlStates), typeof(ControlState), typeof(View), ControlState.All, propertyChanged: (bindable, oldValue, newValue) =>
2936         {
2937             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2938             if (newValue != null)
2939             {
2940                 instance.InternalPropagatableControlStates = (ControlState)newValue;
2941             }
2942         },
2943         defaultValueCreator: (bindable) =>
2944         {
2945             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2946             return instance.InternalPropagatableControlStates;
2947         });
2948
2949         /// <summary>
2950         /// GrabTouchAfterLeaveProperty
2951         /// </summary>
2952         [EditorBrowsable(EditorBrowsableState.Never)]
2953         public static readonly BindableProperty GrabTouchAfterLeaveProperty = BindableProperty.Create(nameof(GrabTouchAfterLeave), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2954         {
2955             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2956             if (newValue != null)
2957             {
2958                 instance.InternalGrabTouchAfterLeave = (bool)newValue;
2959             }
2960         },
2961         defaultValueCreator: (bindable) =>
2962         {
2963             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2964             return instance.InternalGrabTouchAfterLeave;
2965         });
2966
2967         /// <summary>
2968         /// AllowOnlyOwnTouchProperty
2969         /// </summary>
2970         [EditorBrowsable(EditorBrowsableState.Never)]
2971         public static readonly BindableProperty AllowOnlyOwnTouchProperty = BindableProperty.Create(nameof(AllowOnlyOwnTouch), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
2972         {
2973             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2974             if (newValue != null)
2975             {
2976                 instance.InternalAllowOnlyOwnTouch = (bool)newValue;
2977             }
2978         },
2979         defaultValueCreator: (bindable) =>
2980         {
2981             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2982             return instance.InternalAllowOnlyOwnTouch;
2983         });
2984
2985
2986         /// <summary>
2987         /// BlendEquationProperty
2988         /// </summary>
2989         [EditorBrowsable(EditorBrowsableState.Never)]
2990         public static readonly BindableProperty BlendEquationProperty = BindableProperty.Create(nameof(BlendEquation), typeof(BlendEquationType), typeof(View), default(BlendEquationType), propertyChanged: (bindable, oldValue, newValue) =>
2991         {
2992             var instance = (Tizen.NUI.BaseComponents.View)bindable;
2993             if (newValue != null)
2994             {
2995                 instance.InternalBlendEquation = (Tizen.NUI.BlendEquationType)newValue;
2996             }
2997         },
2998         defaultValueCreator: (bindable) =>
2999         {
3000             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3001             return instance.InternalBlendEquation;
3002         });
3003
3004         /// <summary>
3005         /// TransitionOptionsProperty
3006         /// </summary>
3007         [EditorBrowsable(EditorBrowsableState.Never)]
3008         public static readonly BindableProperty TransitionOptionsProperty = BindableProperty.Create(nameof(TransitionOptions), typeof(TransitionOptions), typeof(View), default(TransitionOptions), propertyChanged: (bindable, oldValue, newValue) =>
3009         {
3010             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3011             if (newValue != null)
3012             {
3013                 instance.InternalTransitionOptions = (Tizen.NUI.TransitionOptions)newValue;
3014             }
3015         },
3016         defaultValueCreator: (bindable) =>
3017         {
3018             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3019             return instance.InternalTransitionOptions;
3020         });
3021
3022         /// <summary>
3023         /// AutomationIdProperty
3024         /// </summary>
3025         [EditorBrowsable(EditorBrowsableState.Never)]
3026         public static readonly BindableProperty AutomationIdProperty = BindableProperty.Create(nameof(AutomationId), typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
3027         {
3028             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3029             if (newValue != null)
3030             {
3031
3032                 Object.InternalSetPropertyString(instance.SwigCPtr, View.Property.AutomationId, (string)newValue);
3033             }
3034         },
3035         defaultValueCreator: (bindable) =>
3036         {
3037             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3038
3039             return Object.InternalGetPropertyString(instance.SwigCPtr, View.Property.AutomationId);
3040         });
3041
3042         /// <summary>
3043         /// TouchAreaOffsetProperty
3044         /// </summary>
3045         [EditorBrowsable(EditorBrowsableState.Never)]
3046         public static readonly BindableProperty TouchAreaOffsetProperty = BindableProperty.Create(nameof(TouchAreaOffset), typeof(Offset), typeof(View), default(Offset), propertyChanged: (bindable, oldValue, newValue) =>
3047         {
3048             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3049             if (newValue != null)
3050             {
3051                 instance.InternalTouchAreaOffset = (Tizen.NUI.Offset)newValue;
3052             }
3053         },
3054         defaultValueCreator: (bindable) =>
3055         {
3056             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3057             return instance.InternalTouchAreaOffset;
3058         });
3059
3060         /// <summary>
3061         /// DispatchTouchMotionProperty
3062         /// </summary>
3063         [EditorBrowsable(EditorBrowsableState.Never)]
3064         public static readonly BindableProperty DispatchTouchMotionProperty = BindableProperty.Create(nameof(DispatchTouchMotion), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
3065         {
3066             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3067             if (newValue != null)
3068             {
3069                 instance.InternalDispatchTouchMotion = (bool)newValue;
3070             }
3071         },
3072         defaultValueCreator: (bindable) =>
3073         {
3074             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3075             return instance.InternalDispatchTouchMotion;
3076         });
3077
3078         /// <summary>
3079         /// DispatchHoverMotionProperty
3080         /// </summary>
3081         [EditorBrowsable(EditorBrowsableState.Never)]
3082         public static readonly BindableProperty DispatchHoverMotionProperty = BindableProperty.Create(nameof(DispatchHoverMotion), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
3083         {
3084             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3085             if (newValue != null)
3086             {
3087                 instance.InternalDispatchHoverMotion = (bool)newValue;
3088             }
3089         },
3090         defaultValueCreator: (bindable) =>
3091         {
3092             var instance = (Tizen.NUI.BaseComponents.View)bindable;
3093             return instance.InternalDispatchHoverMotion;
3094         });
3095
3096         /// <summary>
3097         /// Gets View's Size2D set by user.
3098         /// </summary>
3099         internal Size2D GetUserSize2D()
3100         {
3101             return new Size2D((int)userSizeWidth, (int)userSizeHeight);
3102         }
3103
3104 #if REMOVE_READONLY
3105         internal static void CreateBindableProperties()
3106         {
3107             _ = GetBackgroundColorProperty();
3108             _ = GetColorProperty();
3109             _ = GetColorRedProperty();
3110             _ = GetColorGreenProperty();
3111             _ = GetColorBlueProperty();
3112             _ = GetCellIndexProperty();
3113             _ = GetSize2DProperty();
3114             _ = GetPosition2DProperty();
3115             _ = GetParentOriginProperty();
3116             _ = GetPivotPointProperty();
3117             _ = GetSizeWidthProperty();
3118             _ = GetSizeHeightProperty();
3119             _ = GetPositionProperty();
3120             _ = GetPositionXProperty();
3121             _ = GetPositionYProperty();
3122             _ = GetPositionZProperty();
3123             _ = GetScaleProperty();
3124             _ = GetScaleXProperty();
3125             _ = GetScaleYProperty();
3126             _ = GetScaleZProperty();
3127             _ = GetNameProperty();
3128             _ = GetSizeModeFactorProperty();
3129             _ = GetPaddingProperty();
3130             _ = GetSizeProperty();
3131             _ = GetMinimumSizeProperty();
3132             _ = GetMaximumSizeProperty();
3133             _ = GetMarginProperty();
3134             _ = GetAnchorPointProperty();
3135         }
3136 #endif
3137
3138         private void SetBackgroundImage(string value)
3139         {
3140             if (string.IsNullOrEmpty(value))
3141             {
3142                 backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
3143
3144                 var empty = new PropertyValue();
3145                 // Clear background
3146                 Object.SetProperty(SwigCPtr, Property.BACKGROUND, empty);
3147                 empty.Dispose();
3148                 return;
3149             }
3150
3151             if (value.StartsWith("*Resource*"))
3152             {
3153                 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
3154                 value = value.Replace("*Resource*", resource);
3155             }
3156
3157             if (backgroundExtraData == null)
3158             {
3159
3160                 Object.InternalSetPropertyString(SwigCPtr, View.Property.BACKGROUND, value);
3161                 BackgroundImageSynchronousLoading = backgroundImageSynchronousLoading;
3162                 return;
3163             }
3164
3165             var map = new PropertyMap();
3166             var url = new PropertyValue(value);
3167             var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius);
3168             var cornerRadius = new PropertyValue(cornerRadiusValue);
3169             var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy));
3170             var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth);
3171             var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor);
3172             var borderlineColor = new PropertyValue(borderlineColorValue);
3173             var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset);
3174             var synchronousLoading = new PropertyValue(backgroundImageSynchronousLoading);
3175             var npatchType = new PropertyValue((int)Visual.Type.NPatch);
3176             var border = (backgroundExtraData.BackgroundImageBorder != null) ? new PropertyValue(backgroundExtraData.BackgroundImageBorder) : null;
3177             var imageType = new PropertyValue((int)Visual.Type.Image);
3178
3179             map.Add(ImageVisualProperty.URL, url)
3180                .Add(Visual.Property.CornerRadius, cornerRadius)
3181                .Add(Visual.Property.CornerRadiusPolicy, cornerRadiusPolicy)
3182                .Add(Visual.Property.BorderlineWidth, borderlineWidth)
3183                .Add(Visual.Property.BorderlineColor, borderlineColor)
3184                .Add(Visual.Property.BorderlineOffset, borderlineOffset)
3185                .Add(ImageVisualProperty.SynchronousLoading, synchronousLoading);
3186
3187             if (backgroundExtraData.BackgroundImageBorder != null)
3188             {
3189                 map.Add(Visual.Property.Type, npatchType)
3190                    .Add(NpatchImageVisualProperty.Border, border);
3191             }
3192             else
3193             {
3194                 map.Add(Visual.Property.Type, imageType);
3195             }
3196
3197             backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
3198
3199             var mapValue = new PropertyValue(map);
3200             Object.SetProperty(SwigCPtr, Property.BACKGROUND, mapValue);
3201
3202             imageType?.Dispose();
3203             border?.Dispose();
3204             npatchType?.Dispose();
3205             synchronousLoading?.Dispose();
3206             borderlineOffset?.Dispose();
3207             borderlineColor?.Dispose();
3208             borderlineColorValue?.Dispose();
3209             borderlineWidth?.Dispose();
3210             cornerRadiusPolicy?.Dispose();
3211             cornerRadius?.Dispose();
3212             cornerRadiusValue?.Dispose();
3213             url?.Dispose();
3214             map?.Dispose();
3215             mapValue?.Dispose();
3216         }
3217
3218         private void SetBackgroundImageBorder(Rectangle value)
3219         {
3220             bool isEmptyValue = Rectangle.IsNullOrZero(value);
3221
3222             var backgroundImageBorder = isEmptyValue ? null : value;
3223
3224             (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).BackgroundImageBorder = backgroundImageBorder;
3225
3226             if (isEmptyValue)
3227             {
3228                 return;
3229             }
3230
3231             PropertyMap map = Background;
3232
3233             if (map.Empty())
3234             {
3235                 return;
3236             }
3237
3238             map[NpatchImageVisualProperty.Border] = new PropertyValue(backgroundImageBorder);
3239
3240             int visualType = 0;
3241
3242             map.Find(Visual.Property.Type)?.Get(out visualType);
3243
3244             if (visualType == (int)Visual.Type.Image)
3245             {
3246                 map[Visual.Property.Type] = new PropertyValue((int)Visual.Type.NPatch);
3247             }
3248
3249             // Background extra data flag is not meanful anymore.
3250             backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
3251
3252             Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, View.Property.BACKGROUND, new PropertyValue(map));
3253         }
3254
3255         private void SetBorderlineColor(Color value)
3256         {
3257             if (value == null)
3258             {
3259                 return;
3260             }
3261
3262             (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).BorderlineColor = value;
3263
3264             UpdateBackgroundExtraData(BackgroundExtraDataUpdatedFlag.Borderline);
3265         }
3266
3267         private void SetBackgroundColor(Color value)
3268         {
3269             if (value == null)
3270             {
3271                 return;
3272             }
3273
3274             if (backgroundExtraData == null)
3275             {
3276
3277                 Object.InternalSetPropertyVector4(SwigCPtr, View.Property.BACKGROUND, ((Color)value).SwigCPtr);
3278                 return;
3279             }
3280
3281             var map = new PropertyMap();
3282             var colorType = new PropertyValue((int)Visual.Type.Color);
3283             var mixColor = new PropertyValue(value);
3284             var cornerRadiusValue = backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius);
3285             var cornerRadius = new PropertyValue(cornerRadiusValue);
3286             var cornerRadiusPolicy = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy));
3287             var borderlineWidth = new PropertyValue(backgroundExtraData.BorderlineWidth);
3288             var borderlineColorValue = backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor);
3289             var borderlineColor = new PropertyValue(borderlineColorValue);
3290             var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset);
3291
3292             map.Add(Visual.Property.Type, colorType)
3293                .Add(ColorVisualProperty.MixColor, mixColor)
3294                .Add(Visual.Property.CornerRadius, cornerRadius)
3295                .Add(Visual.Property.CornerRadiusPolicy, cornerRadiusPolicy)
3296                .Add(Visual.Property.BorderlineWidth, borderlineWidth)
3297                .Add(Visual.Property.BorderlineColor, borderlineColor)
3298                .Add(Visual.Property.BorderlineOffset, borderlineOffset);
3299
3300             backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Background;
3301
3302             var mapValue = new PropertyValue(map);
3303             Object.SetProperty(SwigCPtr, Property.BACKGROUND, mapValue);
3304
3305             borderlineOffset?.Dispose();
3306             borderlineColor?.Dispose();
3307             borderlineColorValue?.Dispose();
3308             borderlineWidth?.Dispose();
3309             cornerRadiusPolicy?.Dispose();
3310             cornerRadius?.Dispose();
3311             cornerRadiusValue?.Dispose();
3312             mixColor?.Dispose();
3313             colorType?.Dispose();
3314             map?.Dispose();
3315             mapValue?.Dispose();
3316         }
3317
3318         private void SetColor(Color value)
3319         {
3320             if (value == null)
3321             {
3322                 return;
3323             }
3324
3325             Interop.ActorInternal.SetColor(SwigCPtr, value.SwigCPtr);
3326             if (NDalicPINVOKE.SWIGPendingException.Pending)
3327                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3328         }
3329
3330         private void SetColorRed(float? value)
3331         {
3332             if (value == null)
3333             {
3334                 return;
3335             }
3336
3337             Object.InternalSetPropertyFloat(SwigCPtr, View.Property.ColorRed, (float)value);
3338             if (NDalicPINVOKE.SWIGPendingException.Pending)
3339                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3340         }
3341
3342         private void SetColorGreen(float? value)
3343         {
3344             if (value == null)
3345             {
3346                 return;
3347             }
3348
3349             Object.InternalSetPropertyFloat(SwigCPtr, View.Property.ColorGreen, (float)value);
3350             if (NDalicPINVOKE.SWIGPendingException.Pending)
3351                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3352         }
3353
3354         private void SetColorBlue(float? value)
3355         {
3356             if (value == null)
3357             {
3358                 return;
3359             }
3360
3361             Object.InternalSetPropertyFloat(SwigCPtr, View.Property.ColorBlue, (float)value);
3362             if (NDalicPINVOKE.SWIGPendingException.Pending)
3363                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
3364         }
3365
3366         private void SetOpacity(float? value)
3367         {
3368             if (value == null)
3369             {
3370                 return;
3371             }
3372
3373             Object.InternalSetPropertyFloat(SwigCPtr, View.Property.OPACITY, (float)value);
3374         }
3375
3376         private void SetShadow(ShadowBase value)
3377         {
3378             backgroundExtraDataUpdatedFlag &= ~BackgroundExtraDataUpdatedFlag.Shadow;
3379             Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, View.Property.SHADOW, value == null ? new PropertyValue() : value.ToPropertyValue(this));
3380         }
3381     }
3382 }