[NUI] Remove debugging code
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
1 /*
2  * Copyright(c) 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 using System;
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
22
23 namespace Tizen.NUI.BaseComponents
24 {
25     /// <summary>
26     /// View is the base class for all views.
27     /// </summary>
28     /// <since_tizen> 3 </since_tizen>
29     public partial class View : Container, IResourcesProvider
30     {
31         private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
32         private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
33         private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
34         private static bool defaultGrabTouchAfterLeave = false;
35         private static bool defaultAllowOnlyOwnTouch = false;
36
37         internal BackgroundExtraData backgroundExtraData;
38
39         private bool layoutSet = false;
40         private LayoutItem layout; // Exclusive layout assigned to this View.
41
42         // List of transitions paired with the condition that uses the transition.
43         private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
44         private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
45         private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
46         private float weight = 0.0f; // Weighting of child View in a Layout
47         private bool backgroundImageSynchronousLoading = false;
48         private bool excludeLayouting = false;
49         private LayoutTransition layoutTransition;
50         private TransitionOptions transitionOptions = null;
51         private ThemeData themeData;
52         private bool isThemeChanged = false;
53
54         // List of constraints
55         private Constraint widthConstraint = null;
56         private Constraint heightConstraint = null;
57
58         private Size2D internalMaximumSize = null;
59         private Size2D internalMinimumSize = null;
60         private Extents internalMargin = null;
61         private Extents internalPadding = null;
62         private Vector3 internalSizeModeFactor = null;
63         private Vector2 internalCellIndex = null;
64         private Color internalBackgroundColor = null;
65         private Color internalColor = null;
66         private Position internalPivotPoint = null;
67         private Position internalPosition = null;
68         private Position2D internalPosition2D = null;
69         private Vector3 internalScale = null;
70         private Size internalSize = null;
71         private Size2D internalSize2D = null;
72         private int layoutCount = 0;
73         private ControlState propagatableControlStates = ControlState.All;
74
75         // List of dispatch Event
76         private PanGestureDetector panGestureDetector = null;
77         private LongPressGestureDetector longGestureDetector = null;
78         private PinchGestureDetector pinchGestureDetector = null;
79         private TapGestureDetector tapGestureDetector = null;
80         private RotationGestureDetector rotationGestureDetector = null;
81         private int configGestureCount = 0;
82         private bool dispatchTouchEvents = true;
83         private bool dispatchGestureEvents = true;
84         private bool dispatchParentGestureEvents = true;
85
86 #if NUI_PROPERTY_CHANGE_1
87         private string internalName = string.Empty;
88 #endif
89 #if NUI_PROPERTY_CHANGE_3
90         private Vector3 internalCurrentParentOrigin = null;
91         private Vector3 internalCurrentAnchorPoint = null;
92         private Vector3 internalTargetSize = null;
93         private Size2D internalCurrentSize = null;
94         private Vector3 internalNaturalSize = null;
95         private Position internalCurrentPosition = null;
96         private Vector3 internalCurrentWorldPosition = null;
97         private Vector3 internalCurrentScale = null;
98         private Vector3 internalCurrentWorldScale = null;
99         private Vector4 internalCurrentColor = null;
100         private Vector4 internalCurrentWorldColor = null;
101 #endif
102
103         static View()
104         {
105             RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
106             RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
107             RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
108             RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
109
110             RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
111             RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
112             RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
113             RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
114
115             RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
116             RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
117             RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
118             RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
119
120             RegisterAccessibilityDelegate();
121         }
122
123         /// <summary>
124         /// Creates a new instance of a view.
125         /// </summary>
126         /// <since_tizen> 3 </since_tizen>
127         public View() : this(Interop.View.New(), true)
128         {
129             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130         }
131
132         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
133         [EditorBrowsable(EditorBrowsableState.Never)]
134         public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
135         {
136         }
137
138         /// <summary>
139         /// Create a new instance of a View with setting the status of shown or hidden.
140         /// </summary>
141         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
142         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
143         [EditorBrowsable(EditorBrowsableState.Never)]
144         public View(bool shown) : this(Interop.View.New(), true)
145         {
146             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147             SetVisible(shown);
148         }
149
150         internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
151         {
152             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153             if (!shown)
154             {
155                 SetVisible(false);
156             }
157
158             backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
159         }
160
161         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
162         {
163             InitializeStyle(viewStyle);
164         }
165
166         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
167         {
168             if (HasBody())
169             {
170                 PositionUsesPivotPoint = false;
171             }
172
173             onWindowSendEventCallback = SendViewAddedEventToWindow;
174             using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
175             signal?.Connect(onWindowSendEventCallback);
176
177             hitTestResultDataCallback = OnHitTestResult;
178             using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
179             touchDataSignal?.Connect(hitTestResultDataCallback);
180
181             if (!shown)
182             {
183                 SetVisible(false);
184             }
185
186             GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
187             AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
188         }
189
190         internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
191         {
192             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193
194             if (!shown)
195             {
196                 SetVisible(false);
197             }
198         }
199
200         /// <summary>
201         /// The event that is triggered when the View's ControlState is changed.
202         /// </summary>
203         [EditorBrowsable(EditorBrowsableState.Never)]
204         public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
205
206         internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
207
208
209         /// <summary>
210         /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
211         /// </summary>
212         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
213         [EditorBrowsable(EditorBrowsableState.Never)]
214         public bool LayoutSet
215         {
216             get
217             {
218                 return layoutSet;
219             }
220         }
221
222         /// <summary>
223         /// Flag to allow Layouting to be disabled for Views.
224         /// Once a View has a Layout set then any children added to Views from then on will receive
225         /// automatic Layouts.
226         /// </summary>
227         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
228         [EditorBrowsable(EditorBrowsableState.Never)]
229         public static bool LayoutingDisabled { get; set; } = true;
230
231         /// <summary>
232         /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
233         /// </summary>
234         /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
235         [EditorBrowsable(EditorBrowsableState.Never)]
236         public static void SetDefaultGrabTouchAfterLeave(bool enable)
237         {
238             defaultGrabTouchAfterLeave = enable;
239         }
240
241         /// <summary>
242         /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
243         /// </summary>
244         /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
245         [EditorBrowsable(EditorBrowsableState.Never)]
246         public static void SetDefaultAllowOnlyOwnTouch(bool enable)
247         {
248             defaultAllowOnlyOwnTouch = enable;
249         }
250
251         /// <summary>
252         /// Deprecate. Do not use this.
253         /// The style instance applied to this view.
254         /// Note that do not modify the ViewStyle.
255         /// Modifying ViewStyle will affect other views with same ViewStyle.
256         /// </summary>
257         [EditorBrowsable(EditorBrowsableState.Never)]
258         protected ViewStyle ViewStyle
259         {
260             get
261             {
262                 if (themeData == null) themeData = new ThemeData();
263
264                 if (themeData.viewStyle == null)
265                 {
266                     ApplyStyle(CreateViewStyle());
267                 }
268                 return themeData.viewStyle;
269             }
270         }
271
272         /// <summary>
273         /// Get/Set the control state.
274         /// Note that the ControlState only available for the classes derived from Control.
275         /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
276         /// please set <see cref="EnableControlState"/> to true.
277         /// </summary>
278         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
279         [EditorBrowsable(EditorBrowsableState.Never)]
280         public ControlState ControlState
281         {
282             get
283             {
284                 return themeData == null ? ControlState.Normal : themeData.controlStates;
285             }
286             protected set
287             {
288                 if (ControlState == value)
289                 {
290                     return;
291                 }
292
293                 var prevState = ControlState;
294
295                 if (themeData == null) themeData = new ThemeData();
296                 themeData.controlStates = value;
297
298                 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
299
300                 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
301
302                 if (themeData.ControlStatePropagation)
303                 {
304                     foreach (View child in Children)
305                     {
306                         ControlState allowed = child.PropagatableControlStates;
307                         if (allowed.Contains(ControlState.All))
308                         {
309                             child.ControlState = value;
310                         }
311                         else
312                         {
313                             ControlState newControlState = child.ControlState;
314
315                             if (allowed.Contains(ControlState.Normal))
316                             {
317                                 if (value.Contains(ControlState.Normal))
318                                 {
319                                     newControlState += ControlState.Normal;
320                                 }
321                                 else
322                                 {
323                                     newControlState -= ControlState.Normal;
324                                 }
325                             }
326
327                             if (allowed.Contains(ControlState.Disabled))
328                             {
329                                 if (value.Contains(ControlState.Disabled))
330                                 {
331                                     newControlState += ControlState.Disabled;
332                                 }
333                                 else
334                                 {
335                                     newControlState -= ControlState.Disabled;
336                                 }
337                             }
338
339                             if (allowed.Contains(ControlState.Selected))
340                             {
341                                 if (value.Contains(ControlState.Selected))
342                                 {
343                                     newControlState += ControlState.Selected;
344                                 }
345                                 else
346                                 {
347                                     newControlState -= ControlState.Selected;
348                                 }
349                             }
350
351                             if (allowed.Contains(ControlState.Pressed))
352                             {
353                                 if (value.Contains(ControlState.Pressed))
354                                 {
355                                     newControlState += ControlState.Pressed;
356                                 }
357                                 else
358                                 {
359                                     newControlState -= ControlState.Pressed;
360                                 }
361                             }
362
363                             if (allowed.Contains(ControlState.Focused))
364                             {
365                                 if (value.Contains(ControlState.Focused))
366                                 {
367                                     newControlState += ControlState.Focused;
368                                 }
369                                 else
370                                 {
371                                     newControlState -= ControlState.Focused;
372                                 }
373                             }
374
375                             if (allowed.Contains(ControlState.Other))
376                             {
377                                 if (value.Contains(ControlState.Other))
378                                 {
379                                     newControlState += ControlState.Other;
380                                 }
381                                 else
382                                 {
383                                     newControlState -= ControlState.Other;
384                                 }
385                             }
386
387                             if (child.ControlState != newControlState)
388                             child.ControlState = newControlState;
389                         }
390                     }
391                 }
392
393                 OnControlStateChanged(changeInfo);
394
395                 ControlStateChangedEvent?.Invoke(this, changeInfo);
396             }
397         }
398
399         /// <summary>
400         /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
401         /// </summary>
402         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
403         [EditorBrowsable(EditorBrowsableState.Never)]
404         public bool ExcludeLayouting
405         {
406             get
407             {
408                 return (bool)GetValue(ExcludeLayoutingProperty);
409             }
410             set
411             {
412                 SetValue(ExcludeLayoutingProperty, value);
413                 NotifyPropertyChanged();
414             }
415         }
416
417         private bool InternalExcludeLayouting
418         {
419             get
420             {
421                 return excludeLayouting;
422             }
423             set
424             {
425                 excludeLayouting = value;
426                 if (Layout != null && Layout.SetPositionByLayout == value)
427                 {
428                     Layout.SetPositionByLayout = !value;
429                     Layout.RequestLayout();
430                 }
431             }
432         }
433
434         /// <summary>
435         /// The StyleName, type string.
436         /// The value indicates DALi style name defined in json theme file.
437         /// </summary>
438         /// <since_tizen> 3 </since_tizen>
439         public string StyleName
440         {
441             get
442             {
443                 return (string)GetValue(StyleNameProperty);
444             }
445             set
446             {
447                 SetValue(StyleNameProperty, value);
448                 NotifyPropertyChanged();
449             }
450         }
451
452         /// <summary>
453         /// The KeyInputFocus, type bool.
454         /// </summary>
455         [EditorBrowsable(EditorBrowsableState.Never)]
456         public bool KeyInputFocus
457         {
458             get
459             {
460                 return (bool)GetValue(KeyInputFocusProperty);
461             }
462             set
463             {
464                 SetValue(KeyInputFocusProperty, value);
465                 NotifyPropertyChanged();
466             }
467         }
468
469         /// <summary>
470         /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
471         /// </summary>
472         /// <remarks>
473         /// <para>
474         /// The property cascade chaining set is not recommended.
475         /// </para>
476         /// <para>
477         /// Animatable - This property can be animated using <c>Animation</c> class.
478         /// <code>
479         /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
480         /// </code>
481         /// </para>
482         /// </remarks>
483         /// <example>
484         /// This way is recommended for setting the property
485         /// <code>
486         /// var view = new View();
487         /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
488         /// </code>
489         /// This way to set the property is prohibited
490         /// <code>
491         /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
492         /// </code>
493         /// </example>
494         /// <since_tizen> 3 </since_tizen>
495         public Color BackgroundColor
496         {
497             get
498             {
499                 return (Color)GetValue(BackgroundColorProperty);
500             }
501             set
502             {
503                 SetValue(BackgroundColorProperty, value);
504                 NotifyPropertyChanged();
505             }
506         }
507
508         /// <summary>
509         /// The mutually exclusive with "backgroundColor" and "background" type Map.
510         /// </summary>
511         /// <since_tizen> 3 </since_tizen>
512         public string BackgroundImage
513         {
514             get
515             {
516                 return (string)GetValue(BackgroundImageProperty);
517             }
518             set
519             {
520                 SetValue(BackgroundImageProperty, value);
521                 NotifyPropertyChanged();
522             }
523         }
524
525         /// <summary>
526         /// Get or set the border of background image.
527         /// </summary>
528         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
529         [EditorBrowsable(EditorBrowsableState.Never)]
530         public Rectangle BackgroundImageBorder
531         {
532             get
533             {
534                 return (Rectangle)GetValue(BackgroundImageBorderProperty);
535             }
536             set
537             {
538                 SetValue(BackgroundImageBorderProperty, value);
539                 NotifyPropertyChanged();
540             }
541         }
542
543         /// <summary>
544         /// The background of view.
545         /// </summary>
546         /// <since_tizen> 3 </since_tizen>
547         public Tizen.NUI.PropertyMap Background
548         {
549             get
550             {
551                 return (PropertyMap)GetValue(BackgroundProperty);
552             }
553             set
554             {
555                 SetValue(BackgroundProperty, value);
556                 NotifyPropertyChanged();
557             }
558         }
559
560         /// <summary>
561         /// Describes a shadow as an image for a View.
562         /// It is null by default.
563         /// </summary>
564         /// <remarks>
565         /// Getter returns copied instance of current shadow.
566         /// </remarks>
567         /// <remarks>
568         /// The mutually exclusive with "BoxShadow".
569         /// </remarks>
570         /// <remarks>
571         /// <para>
572         /// Animatable - This property can be animated using <c>Animation</c> class.
573         /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
574         /// <code>
575         /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
576         /// </code>
577         /// Animatable sub-property : Offset.
578         /// </para>
579         /// </remarks>
580         [EditorBrowsable(EditorBrowsableState.Never)]
581         public ImageShadow ImageShadow
582         {
583             get
584             {
585                 return (ImageShadow)GetValue(ImageShadowProperty);
586             }
587             set
588             {
589                 SetValue(ImageShadowProperty, value);
590                 NotifyPropertyChanged();
591             }
592         }
593
594         /// <summary>
595         /// Describes a box shaped shadow drawing for a View.
596         /// It is null by default.
597         /// </summary>
598         /// <remarks>
599         /// The mutually exclusive with "ImageShadow".
600         /// </remarks>
601         /// <remarks>
602         /// <para>
603         /// Animatable - This property can be animated using <c>Animation</c> class.
604         /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
605         /// <code>
606         /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
607         /// </code>
608         /// Animatable sub-property : Offset, Color, BlurRadius.
609         /// </para>
610         /// </remarks>
611         /// <since_tizen> 9 </since_tizen>
612         public Shadow BoxShadow
613         {
614             get
615             {
616                 return (Shadow)GetValue(BoxShadowProperty);
617             }
618             set
619             {
620                 SetValue(BoxShadowProperty, value);
621                 NotifyPropertyChanged();
622             }
623         }
624
625         /// <summary>
626         /// The radius for the rounded corners of the View.
627         /// This will rounds background and shadow edges.
628         /// The values in Vector4 are used in clockwise order from top-left to bottom-left : Vector4(top-left-corner, top-right-corner, bottom-right-corner, bottom-left-corner).
629         /// Each radius will clamp internally to the half of smaller of the view's width or height.
630         /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
631         /// </summary>
632         /// <remarks>
633         /// <para>
634         /// Animatable - This property can be animated using <c>Animation</c> class.
635         /// <code>
636         /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
637         /// </code>
638         /// </para>
639         /// </remarks>
640         /// <since_tizen> 9 </since_tizen>
641         public Vector4 CornerRadius
642         {
643             get
644             {
645                 return (Vector4)GetValue(CornerRadiusProperty);
646             }
647             set
648             {
649                 SetValue(CornerRadiusProperty, value);
650                 NotifyPropertyChanged();
651             }
652         }
653
654         /// <summary>
655         /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
656         /// It is absolute by default.
657         /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
658         /// </summary>
659         /// <since_tizen> 9 </since_tizen>
660         public VisualTransformPolicyType CornerRadiusPolicy
661         {
662             get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
663             set => SetValue(CornerRadiusPolicyProperty, value);
664         }
665
666         /// <summary>
667         /// The width for the borderline of the View.
668         /// </summary>
669         /// <remarks>
670         /// <para>
671         /// Animatable - This property can be animated using <c>Animation</c> class.
672         /// <code>
673         /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
674         /// </code>
675         /// </para>
676         /// Note that, an image background may not have borderline if it uses the Border property.
677         /// </remarks>
678         /// <since_tizen> 9 </since_tizen>
679         public float BorderlineWidth
680         {
681             get
682             {
683                 return (float)GetValue(BorderlineWidthProperty);
684             }
685             set
686             {
687                 SetValue(BorderlineWidthProperty, value);
688                 NotifyPropertyChanged();
689             }
690         }
691
692         /// <summary>
693         /// The color for the borderline of the View.
694         /// It is Color.Black by default.
695         /// </summary>
696         /// <remarks>
697         /// <para>
698         /// Animatable - This property can be animated using <c>Animation</c> class.
699         /// <code>
700         /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
701         /// </code>
702         /// </para>
703         /// </remarks>
704         /// <since_tizen> 9 </since_tizen>
705         public Color BorderlineColor
706         {
707             get
708             {
709                 return (Color)GetValue(BorderlineColorProperty);
710             }
711             set
712             {
713                 SetValue(BorderlineColorProperty, value);
714                 NotifyPropertyChanged();
715             }
716         }
717
718         /// <summary>
719         /// The color selector for the borderline of the View.
720         /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
721         /// So this API is internally used only.
722         /// </summary>
723         internal Selector<Color> BorderlineColorSelector
724         {
725             get
726             {
727                 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
728             }
729             set
730             {
731                 SetValue(BorderlineColorSelectorProperty, value);
732                 NotifyPropertyChanged();
733             }
734         }
735
736         /// <summary>
737         /// The Relative offset for the borderline of the View.
738         /// Recommended range : [-1.0f to 1.0f].
739         /// If -1.0f, draw borderline inside of the View.
740         /// If 1.0f, draw borderline outside of the View.
741         /// If 0.0f, draw borderline half inside and half outside.
742         /// It is 0.0f by default.
743         /// </summary>
744         /// <remarks>
745         /// <para>
746         /// Animatable - This property can be animated using <c>Animation</c> class.
747         /// <code>
748         /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
749         /// </code>
750         /// </para>
751         /// </remarks>
752         /// <since_tizen> 9 </since_tizen>
753         public float BorderlineOffset
754         {
755             get
756             {
757                 return (float)GetValue(BorderlineOffsetProperty);
758             }
759             set
760             {
761                 SetValue(BorderlineOffsetProperty, value);
762                 NotifyPropertyChanged();
763             }
764         }
765
766         /// <summary>
767         /// The current state of the view.
768         /// </summary>
769         /// <since_tizen> 3 </since_tizen>
770         public States State
771         {
772             get
773             {
774                 return (States)GetValue(StateProperty);
775             }
776             set
777             {
778                 SetValue(StateProperty, value);
779                 NotifyPropertyChanged();
780             }
781         }
782
783         /// <summary>
784         /// The current sub state of the view.
785         /// </summary>
786         /// <since_tizen> 3 </since_tizen>
787         public States SubState
788         {
789             get
790             {
791                 return (States)GetValue(SubStateProperty);
792             }
793             set
794             {
795                 SetValue(SubStateProperty, value);
796                 NotifyPropertyChanged();
797             }
798         }
799
800         /// <summary>
801         /// Displays a tooltip
802         /// </summary>
803         /// <since_tizen> 3 </since_tizen>
804         public Tizen.NUI.PropertyMap Tooltip
805         {
806             get
807             {
808                 return (PropertyMap)GetValue(TooltipProperty);
809             }
810             set
811             {
812                 SetValue(TooltipProperty, value);
813                 NotifyPropertyChanged();
814             }
815         }
816
817         /// <summary>
818         /// Displays a tooltip as a text.
819         /// </summary>
820         /// <since_tizen> 3 </since_tizen>
821         public string TooltipText
822         {
823             get
824             {
825                 return GetValue(TooltipTextProperty) as string;
826             }
827             set
828             {
829                 SetValue(TooltipTextProperty, value);
830             }
831         }
832
833         private string InternalTooltipText
834         {
835             get
836             {
837                 using (var propertyValue = GetProperty(Property.TOOLTIP))
838                 {
839                     if (propertyValue != null && propertyValue.Get(out string retrivedValue))
840                     {
841                         return retrivedValue;
842                     }
843                     NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
844                     return "error to get TooltipText";
845                 }
846             }
847             set
848             {
849                 var temp = new Tizen.NUI.PropertyValue(value);
850                 SetProperty(View.Property.TOOLTIP, temp);
851                 temp.Dispose();
852                 NotifyPropertyChanged();
853             }
854         }
855
856         /// <summary>
857         /// The Child property of FlexContainer.<br />
858         /// The proportion of the free space in the container, the flex item will receive.<br />
859         /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
860         /// </summary>
861         /// <since_tizen> 3 </since_tizen>
862         [Obsolete("Deprecated in API8, will be removed in API10.")]
863         public float Flex
864         {
865             get
866             {
867                 return (float)GetValue(FlexProperty);
868             }
869             set
870             {
871                 SetValue(FlexProperty, value);
872                 NotifyPropertyChanged();
873             }
874         }
875
876         /// <summary>
877         /// The Child property of FlexContainer.<br />
878         /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
879         /// </summary>
880         /// <since_tizen> 3 </since_tizen>
881         [Obsolete("Deprecated in API8, will be removed in API10.")]
882         public int AlignSelf
883         {
884             get
885             {
886                 return (int)GetValue(AlignSelfProperty);
887             }
888             set
889             {
890                 SetValue(AlignSelfProperty, value);
891                 NotifyPropertyChanged();
892             }
893         }
894
895         /// <summary>
896         /// The Child property of FlexContainer.<br />
897         /// The space around the flex item.<br />
898         /// </summary>
899         /// <remarks>
900         /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
901         /// </remarks>
902         /// <since_tizen> 3 </since_tizen>
903         [Obsolete("Deprecated in API8, will be removed in API10.")]
904         public Vector4 FlexMargin
905         {
906             get
907             {
908                 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
909                 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
910             }
911             set
912             {
913                 SetValue(FlexMarginProperty, value);
914                 NotifyPropertyChanged();
915             }
916         }
917
918         /// <summary>
919         /// The top-left cell this child occupies, if not set, the first available cell is used.
920         /// </summary>
921         /// <remarks>
922         /// The property cascade chaining set is not recommended.
923         /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
924         /// </remarks>
925         /// <example>
926         /// This way is recommended for setting the property
927         /// <code>
928         /// var view = new View();
929         /// view.CellIndex = new Vector2(1, 3);
930         /// </code>
931         /// This way to set the property is prohibited
932         /// <code>
933         /// view.CellIndex.X = 1; //This does not guarantee a proper operation
934         /// </code>
935         /// </example>
936         /// <since_tizen> 3 </since_tizen>
937         public Vector2 CellIndex
938         {
939             get
940             {
941                 return (Vector2)GetValue(CellIndexProperty);
942             }
943             set
944             {
945                 SetValue(CellIndexProperty, value);
946                 NotifyPropertyChanged();
947             }
948         }
949
950         /// <summary>
951         /// The number of rows this child occupies, if not set, the default value is 1.
952         /// </summary>
953         /// <remarks>
954         /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
955         /// </remarks>
956         /// <since_tizen> 3 </since_tizen>
957         public float RowSpan
958         {
959             get
960             {
961                 return (float)GetValue(RowSpanProperty);
962             }
963             set
964             {
965                 SetValue(RowSpanProperty, value);
966                 NotifyPropertyChanged();
967             }
968         }
969
970         /// <summary>
971         /// The number of columns this child occupies, if not set, the default value is 1.
972         /// </summary>
973         /// <remarks>
974         /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
975         /// </remarks>
976         /// <since_tizen> 3 </since_tizen>
977         public float ColumnSpan
978         {
979             get
980             {
981                 return (float)GetValue(ColumnSpanProperty);
982             }
983             set
984             {
985                 SetValue(ColumnSpanProperty, value);
986                 NotifyPropertyChanged();
987             }
988         }
989
990         /// <summary>
991         /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
992         /// </summary>
993         /// <remarks>
994         /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
995         /// </remarks>
996         /// <since_tizen> 3 </since_tizen>
997         public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
998         {
999             get
1000             {
1001                 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1002             }
1003             set
1004             {
1005                 SetValue(CellHorizontalAlignmentProperty, value);
1006                 NotifyPropertyChanged();
1007             }
1008         }
1009
1010         /// <summary>
1011         /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1012         /// </summary>
1013         /// <remarks>
1014         /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1015         /// </remarks>
1016         /// <since_tizen> 3 </since_tizen>
1017         public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1018         {
1019             get
1020             {
1021                 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1022             }
1023             set
1024             {
1025                 SetValue(CellVerticalAlignmentProperty, value);
1026                 NotifyPropertyChanged();
1027             }
1028         }
1029
1030         /// <summary>
1031         /// The left focusable view.<br />
1032         /// This will return null if not set.<br />
1033         /// This will also return null if the specified left focusable view is not on a window.<br />
1034         /// </summary>
1035         /// <since_tizen> 3 </since_tizen>
1036         public View LeftFocusableView
1037         {
1038             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1039             get
1040             {
1041                 return (View)GetValue(LeftFocusableViewProperty);
1042             }
1043             set
1044             {
1045                 SetValue(LeftFocusableViewProperty, value);
1046                 NotifyPropertyChanged();
1047             }
1048         }
1049
1050         /// <summary>
1051         /// The right focusable view.<br />
1052         /// This will return null if not set.<br />
1053         /// This will also return null if the specified right focusable view is not on a window.<br />
1054         /// </summary>
1055         /// <since_tizen> 3 </since_tizen>
1056         public View RightFocusableView
1057         {
1058             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1059             get
1060             {
1061                 return (View)GetValue(RightFocusableViewProperty);
1062             }
1063             set
1064             {
1065                 SetValue(RightFocusableViewProperty, value);
1066                 NotifyPropertyChanged();
1067             }
1068         }
1069
1070         /// <summary>
1071         /// The up focusable view.<br />
1072         /// This will return null if not set.<br />
1073         /// This will also return null if the specified up focusable view is not on a window.<br />
1074         /// </summary>
1075         /// <since_tizen> 3 </since_tizen>
1076         public View UpFocusableView
1077         {
1078             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1079             get
1080             {
1081                 return (View)GetValue(UpFocusableViewProperty);
1082             }
1083             set
1084             {
1085                 SetValue(UpFocusableViewProperty, value);
1086                 NotifyPropertyChanged();
1087             }
1088         }
1089
1090         /// <summary>
1091         /// The down focusable view.<br />
1092         /// This will return null if not set.<br />
1093         /// This will also return null if the specified down focusable view is not on a window.<br />
1094         /// </summary>
1095         /// <since_tizen> 3 </since_tizen>
1096         public View DownFocusableView
1097         {
1098             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1099             get
1100             {
1101                 return (View)GetValue(DownFocusableViewProperty);
1102             }
1103             set
1104             {
1105                 SetValue(DownFocusableViewProperty, value);
1106                 NotifyPropertyChanged();
1107             }
1108         }
1109
1110         /// <summary>
1111         /// The clockwise focusable view by rotary wheel.<br />
1112         /// This will return null if not set.<br />
1113         /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1114         /// </summary>
1115         [EditorBrowsable(EditorBrowsableState.Never)]
1116         public View ClockwiseFocusableView
1117         {
1118             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1119             get
1120             {
1121                 return (View)GetValue(ClockwiseFocusableViewProperty);
1122             }
1123             set
1124             {
1125                 SetValue(ClockwiseFocusableViewProperty, value);
1126                 NotifyPropertyChanged();
1127             }
1128         }
1129
1130         /// <summary>
1131         /// The counter clockwise focusable view by rotary wheel.<br />
1132         /// This will return null if not set.<br />
1133         /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1134         /// </summary>
1135         [EditorBrowsable(EditorBrowsableState.Never)]
1136         public View CounterClockwiseFocusableView
1137         {
1138             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1139             get
1140             {
1141                 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1142             }
1143             set
1144             {
1145                 SetValue(CounterClockwiseFocusableViewProperty, value);
1146                 NotifyPropertyChanged();
1147             }
1148         }
1149
1150         /// <summary>
1151         /// Whether the view should be focusable by keyboard navigation.
1152         /// </summary>
1153         /// <since_tizen> 3 </since_tizen>
1154         public bool Focusable
1155         {
1156             set
1157             {
1158                 SetValue(FocusableProperty, value);
1159                 NotifyPropertyChanged();
1160             }
1161             get
1162             {
1163                 return (bool)GetValue(FocusableProperty);
1164             }
1165         }
1166
1167         /// <summary>
1168         /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
1169         /// Note : Default value is true.
1170         /// </summary>
1171         [EditorBrowsable(EditorBrowsableState.Never)]
1172         public bool FocusableChildren
1173         {
1174             set
1175             {
1176                 SetValue(FocusableChildrenProperty, value);
1177                 NotifyPropertyChanged();
1178             }
1179             get
1180             {
1181                 return (bool)GetValue(FocusableChildrenProperty);
1182             }
1183         }
1184
1185         /// <summary>
1186         /// Whether this view can focus by touch.
1187         /// If Focusable is false, FocusableInTouch is disabled.
1188         /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1189         /// </summary>
1190         [EditorBrowsable(EditorBrowsableState.Never)]
1191         public bool FocusableInTouch
1192         {
1193             set
1194             {
1195                 SetValue(FocusableInTouchProperty, value);
1196                 NotifyPropertyChanged();
1197             }
1198             get
1199             {
1200                 return (bool)GetValue(FocusableInTouchProperty);
1201             }
1202         }
1203
1204         /// <summary>
1205         /// Retrieves the position of the view.
1206         /// The coordinates are relative to the view's parent.
1207         /// </summary>
1208         /// <remarks>
1209         /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1210         /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1211         /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1212         /// and users can get the current actual values through them.
1213         /// </remarks>
1214         /// <since_tizen> 3 </since_tizen>
1215         public Position CurrentPosition
1216         {
1217             get
1218             {
1219                 return GetCurrentPosition();
1220             }
1221         }
1222
1223         /// <summary>
1224         /// Sets the size of a view for the width and the height.<br />
1225         /// Geometry can be scaled to fit within this area.<br />
1226         /// This does not interfere with the view's scale factor.<br />
1227         /// The views default depth is the minimum of width and height.<br />
1228         /// </summary>
1229         /// <remarks>
1230         /// The property cascade chaining set is not recommended.
1231         /// </remarks>
1232         /// <example>
1233         /// This way is recommended for setting the property
1234         /// <code>
1235         /// var view = new View();
1236         /// view.Size2D = new Size2D(100, 200);
1237         /// </code>
1238         /// This way to set the property is prohibited
1239         /// <code>
1240         /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1241         /// </code>
1242         /// </example>
1243         /// <since_tizen> 3 </since_tizen>
1244         public Size2D Size2D
1245         {
1246             get
1247             {
1248                 var temp = (Size2D)GetValue(Size2DProperty);
1249
1250                 if (this.Layout == null)
1251                 {
1252                     if (temp.Width < 0) { temp.Width = 0; }
1253                     if (temp.Height < 0) { temp.Height = 0; }
1254                 }
1255
1256                 return temp;
1257             }
1258             set
1259             {
1260                 SetValue(Size2DProperty, value);
1261
1262                 NotifyPropertyChanged();
1263             }
1264         }
1265
1266         /// <summary>
1267         /// Retrieves the size of the view.
1268         /// The coordinates are relative to the view's parent.
1269         /// </summary>
1270         /// <remarks>
1271         /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1272         /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1273         /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1274         /// and users can get the current actual values through them.
1275         /// </remarks>
1276         /// <since_tizen> 3 </since_tizen>
1277         public Size2D CurrentSize
1278         {
1279             get
1280             {
1281                 return GetCurrentSize();
1282             }
1283         }
1284
1285         /// <summary>
1286         /// Retrieves and sets the view's opacity.<br />
1287         /// </summary>
1288         /// <remarks>
1289         /// <para>
1290         /// Animatable - This property can be animated using <c>Animation</c> class.
1291         /// <code>
1292         /// animation.AnimateTo(view, "Opacity", 0.5f);
1293         /// </code>
1294         /// </para>
1295         /// </remarks>
1296         /// <since_tizen> 3 </since_tizen>
1297         public float Opacity
1298         {
1299             get
1300             {
1301                 return (float)GetValue(OpacityProperty);
1302             }
1303             set
1304             {
1305                 SetValue(OpacityProperty, value);
1306                 NotifyPropertyChanged();
1307             }
1308         }
1309
1310         /// <summary>
1311         /// Sets the position of the view for X and Y.<br />
1312         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1313         /// If the position inheritance is disabled, sets the world position.<br />
1314         /// </summary>
1315         /// <remarks>
1316         /// The property cascade chaining set is not recommended.
1317         ///</remarks>
1318         /// <example>
1319         /// This way is recommended for setting the property
1320         /// <code>
1321         /// var view = new View();
1322         /// view.Position2D = new Position2D(100, 200);
1323         /// </code>
1324         /// This way to set the property is prohibited
1325         /// <code>
1326         /// view.Position2D.X = 100; //This does not guarantee a proper operation
1327         /// </code>
1328         /// </example>
1329         /// <since_tizen> 3 </since_tizen>
1330         public Position2D Position2D
1331         {
1332             get
1333             {
1334                 return (Position2D)GetValue(Position2DProperty);
1335             }
1336             set
1337             {
1338                 SetValue(Position2DProperty, value);
1339                 NotifyPropertyChanged();
1340             }
1341         }
1342
1343         /// <summary>
1344         /// Retrieves the screen position of the view.<br />
1345         /// </summary>
1346         /// <since_tizen> 3 </since_tizen>
1347         public Vector2 ScreenPosition
1348         {
1349             get
1350             {
1351                 Vector2 temp = new Vector2(0.0f, 0.0f);
1352                 var pValue = GetProperty(View.Property.ScreenPosition);
1353                 pValue.Get(temp);
1354                 pValue.Dispose();
1355                 return temp;
1356             }
1357         }
1358
1359         /// <summary>
1360         /// Determines whether the pivot point should be used to determine the position of the view.
1361         /// This is false by default.
1362         /// </summary>
1363         /// <remarks>If false, then the top-left of the view is used for the position.
1364         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1365         /// </remarks>
1366         /// <since_tizen> 3 </since_tizen>
1367         public bool PositionUsesPivotPoint
1368         {
1369             get
1370             {
1371                 return (bool)GetValue(PositionUsesPivotPointProperty);
1372             }
1373             set
1374             {
1375                 SetValue(PositionUsesPivotPointProperty, value);
1376                 NotifyPropertyChanged();
1377             }
1378         }
1379
1380         /// <summary>
1381         /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1382         /// </summary>
1383         /// <since_tizen> 3 </since_tizen>
1384         [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1385             "Like: " +
1386             "View view = new View(); " +
1387             "view.PivotPoint = PivotPoint.Center; " +
1388             "view.PositionUsesPivotPoint = true;" +
1389             " This has been deprecated in API5 and will be removed in API8")]
1390         [EditorBrowsable(EditorBrowsableState.Never)]
1391         public bool PositionUsesAnchorPoint
1392         {
1393             get
1394             {
1395                 return (bool)GetValue(PositionUsesAnchorPointProperty);
1396             }
1397             set
1398             {
1399                 SetValue(PositionUsesAnchorPointProperty, value);
1400             }
1401         }
1402
1403         private bool InternalPositionUsesAnchorPoint
1404         {
1405             get
1406             {
1407                 bool temp = false;
1408                 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1409                 pValue.Get(out temp);
1410                 pValue.Dispose();
1411                 return temp;
1412             }
1413             set
1414             {
1415                 var temp = new Tizen.NUI.PropertyValue(value);
1416                 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1417                 temp.Dispose();
1418                 NotifyPropertyChanged();
1419             }
1420         }
1421
1422         /// <summary>
1423         /// Queries whether the view is connected to the stage.<br />
1424         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1425         /// </summary>
1426         /// <since_tizen> 3 </since_tizen>
1427         public bool IsOnWindow
1428         {
1429             get
1430             {
1431                 return OnWindow();
1432             }
1433         }
1434
1435         /// <summary>
1436         /// Gets the depth in the hierarchy for the view.
1437         /// </summary>
1438         /// <since_tizen> 3 </since_tizen>
1439         public int HierarchyDepth
1440         {
1441             get
1442             {
1443                 return GetHierarchyDepth();
1444             }
1445         }
1446
1447         /// <summary>
1448         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1449         /// </summary>
1450         /// <remarks>
1451         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1452         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1453         /// The values set by this property will likely change.
1454         /// </remarks>
1455         /// <since_tizen> 3 </since_tizen>
1456         public int SiblingOrder
1457         {
1458             get
1459             {
1460                 return (int)GetValue(SiblingOrderProperty);
1461             }
1462             set
1463             {
1464                 SetValue(SiblingOrderProperty, value);
1465
1466                 Layout?.ChangeLayoutSiblingOrder(value);
1467
1468                 NotifyPropertyChanged();
1469             }
1470         }
1471
1472         /// <summary>
1473         /// Returns the natural size of the view.
1474         /// </summary>
1475         /// <remarks>
1476         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1477         /// </remarks>
1478         /// <since_tizen> 5 </since_tizen>
1479         public Vector3 NaturalSize
1480         {
1481             get
1482             {
1483                 Vector3 ret = GetNaturalSize();
1484                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1485                 return ret;
1486             }
1487         }
1488
1489         /// <summary>
1490         /// Returns the natural size (Size2D) of the view.
1491         /// </summary>
1492         /// <remarks>
1493         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1494         /// </remarks>
1495         /// <since_tizen> 4 </since_tizen>
1496         public Size2D NaturalSize2D
1497         {
1498             get
1499             {
1500                 Vector3 temp = GetNaturalSize();
1501                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1502
1503                 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1504                 temp.Dispose();
1505                 return sz;
1506             }
1507         }
1508
1509         /// <summary>
1510         /// Gets or sets the origin of a view within its parent's area.<br />
1511         /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1512         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1513         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1514         /// </summary>
1515         /// <pre>The view has been initialized.</pre>
1516         /// <since_tizen> 3 </since_tizen>
1517         public Position ParentOrigin
1518         {
1519             get
1520             {
1521                 Position tmp = (Position)GetValue(ParentOriginProperty);
1522                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1523             }
1524             set
1525             {
1526                 SetValue(ParentOriginProperty, value);
1527                 NotifyPropertyChanged();
1528             }
1529         }
1530
1531         /// <summary>
1532         /// Gets or sets the anchor-point of a view.<br />
1533         /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1534         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1535         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1536         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1537         /// <pre>The view has been initialized.</pre>
1538         /// </summary>
1539         /// <remarks>
1540         /// The property cascade chaining set is not recommended.
1541         ///</remarks>
1542         /// <example>
1543         /// This way is recommended for setting the property
1544         /// <code>
1545         /// var view = new View();
1546         /// view.PivotPoint = PivotPoint.Center;
1547         /// </code>
1548         /// This way to set the property is prohibited
1549         /// <code>
1550         /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1551         /// </code>
1552         /// </example>
1553         /// <since_tizen> 3 </since_tizen>
1554         public Position PivotPoint
1555         {
1556             get
1557             {
1558                 return (Position)GetValue(PivotPointProperty);
1559             }
1560             set
1561             {
1562                 SetValue(PivotPointProperty, value);
1563                 NotifyPropertyChanged();
1564             }
1565         }
1566
1567         /// <summary>
1568         /// Gets or sets the size width of the view.
1569         /// </summary>
1570         /// <remarks>
1571         /// <para>
1572         /// Animatable - This property can be animated using <c>Animation</c> class.
1573         /// <code>
1574         /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1575         /// </code>
1576         /// </para>
1577         /// </remarks>
1578         /// <since_tizen> 3 </since_tizen>
1579         public float SizeWidth
1580         {
1581             get
1582             {
1583                 return (float)GetValue(SizeWidthProperty);
1584             }
1585             set
1586             {
1587                 SetValue(SizeWidthProperty, value);
1588                 NotifyPropertyChanged();
1589             }
1590         }
1591
1592         /// <summary>
1593         /// Gets or sets the size height of the view.
1594         /// </summary>
1595         /// <remarks>
1596         /// <para>
1597         /// Animatable - This property can be animated using <c>Animation</c> class.
1598         /// </para>
1599         /// <code>
1600         /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1601         /// </code>
1602         /// </remarks>
1603         /// <since_tizen> 3 </since_tizen>
1604         public float SizeHeight
1605         {
1606             get
1607             {
1608                 return (float)GetValue(SizeHeightProperty);
1609             }
1610             set
1611             {
1612                 SetValue(SizeHeightProperty, value);
1613                 NotifyPropertyChanged();
1614             }
1615         }
1616
1617         /// <summary>
1618         /// Gets or sets the position of the view.<br />
1619         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1620         /// If the position inheritance is disabled, sets the world position.<br />
1621         /// </summary>
1622         /// <remarks>
1623         /// <para>
1624         /// Animatable - This property can be animated using <c>Animation</c> class.
1625         /// <code>
1626         /// animation.AnimateTo(view, "Position", new Position(50, 0));
1627         /// </code>
1628         /// </para>
1629         /// The property cascade chaining set is not recommended.
1630         /// </remarks>
1631         /// <example>
1632         /// This way is recommended for setting the property
1633         /// <code>
1634         /// var view = new View();
1635         /// view.Position = new Position(100, 200.5f, 0);
1636         /// </code>
1637         /// This way to set the property is prohibited
1638         /// <code>
1639         /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1640         /// </code>
1641         /// </example>
1642         /// <since_tizen> 3 </since_tizen>
1643         public Position Position
1644         {
1645             get
1646             {
1647                 return (Position)GetValue(PositionProperty);
1648             }
1649             set
1650             {
1651                 SetValue(PositionProperty, value);
1652                 NotifyPropertyChanged();
1653             }
1654         }
1655
1656         /// <summary>
1657         /// Gets or sets the position X of the view.
1658         /// </summary>
1659         /// <remarks>
1660         /// <para>
1661         /// Animatable - This property can be animated using <c>Animation</c> class.
1662         /// <code>
1663         /// animation.AnimateTo(view, "PositionX", 50.0f);
1664         /// </code>
1665         /// </para>
1666         /// </remarks>
1667         /// <since_tizen> 3 </since_tizen>
1668         public float PositionX
1669         {
1670             get
1671             {
1672                 return (float)GetValue(PositionXProperty);
1673             }
1674             set
1675             {
1676                 SetValue(PositionXProperty, value);
1677                 NotifyPropertyChanged();
1678             }
1679         }
1680
1681         /// <summary>
1682         /// Gets or sets the position Y of the view.
1683         /// </summary>
1684         /// <remarks>
1685         /// <para>
1686         /// Animatable - This property can be animated using <c>Animation</c> class.
1687         /// <code>
1688         /// animation.AnimateTo(view, "PositionY", 50.0f);
1689         /// </code>
1690         /// </para>
1691         /// </remarks>
1692         /// <since_tizen> 3 </since_tizen>
1693         public float PositionY
1694         {
1695             get
1696             {
1697                 return (float)GetValue(PositionYProperty);
1698             }
1699             set
1700             {
1701                 SetValue(PositionYProperty, value);
1702                 NotifyPropertyChanged();
1703             }
1704         }
1705
1706         /// <summary>
1707         /// Gets or sets the position Z of the view.
1708         /// </summary>
1709         /// <remarks>
1710         /// <para>
1711         /// Animatable - This property can be animated using <c>Animation</c> class.
1712         /// <code>
1713         /// animation.AnimateTo(view, "PositionZ", 50.0f);
1714         /// </code>
1715         /// </para>
1716         /// </remarks>
1717         /// <since_tizen> 3 </since_tizen>
1718         public float PositionZ
1719         {
1720             get
1721             {
1722                 return (float)GetValue(PositionZProperty);
1723             }
1724             set
1725             {
1726                 SetValue(PositionZProperty, value);
1727                 NotifyPropertyChanged();
1728             }
1729         }
1730
1731         /// <summary>
1732         /// Gets or sets the world position of the view.
1733         /// </summary>
1734         /// <since_tizen> 3 </since_tizen>
1735         public Vector3 WorldPosition
1736         {
1737             get
1738             {
1739                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1740                 var pValue = GetProperty(View.Property.WorldPosition);
1741                 pValue.Get(temp);
1742                 pValue.Dispose();
1743                 return temp;
1744             }
1745         }
1746
1747         /// <summary>
1748         /// Gets or sets the orientation of the view.<br />
1749         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1750         /// </summary>
1751         /// <remarks>
1752         /// <para>
1753         /// This is an asynchronous method.
1754         /// </para>
1755         /// <para>
1756         /// Animatable - This property can be animated using <c>Animation</c> class.
1757         /// <code>
1758         /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1759         /// </code>
1760         /// </para>
1761         /// </remarks>
1762         /// <since_tizen> 3 </since_tizen>
1763         public Rotation Orientation
1764         {
1765             get
1766             {
1767                 return (Rotation)GetValue(OrientationProperty);
1768             }
1769             set
1770             {
1771                 SetValue(OrientationProperty, value);
1772                 NotifyPropertyChanged();
1773             }
1774         }
1775
1776         /// <summary>
1777         /// Gets or sets the world orientation of the view.<br />
1778         /// </summary>
1779         /// <since_tizen> 3 </since_tizen>
1780         public Rotation WorldOrientation
1781         {
1782             get
1783             {
1784                 Rotation temp = new Rotation();
1785                 var pValue = GetProperty(View.Property.WorldOrientation);
1786                 pValue.Get(temp);
1787                 pValue.Dispose();
1788                 return temp;
1789             }
1790         }
1791
1792         /// <summary>
1793         /// Gets or sets the scale factor applied to the view.<br />
1794         /// </summary>
1795         /// <remarks>
1796         /// <para>
1797         /// Animatable - This property can be animated using <c>Animation</c> class.
1798         /// <code>
1799         /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1800         /// </code>
1801         /// </para>
1802         /// The property cascade chaining set is not recommended.
1803         /// </remarks>
1804         /// <example>
1805         /// This way is recommended for setting the property
1806         /// <code>
1807         /// var view = new View();
1808         /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1809         /// </code>
1810         /// This way to set the property is prohibited
1811         /// <code>
1812         /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1813         /// </code>
1814         /// </example>
1815         /// <since_tizen> 3 </since_tizen>
1816         public Vector3 Scale
1817         {
1818             get
1819             {
1820                 return (Vector3)GetValue(ScaleProperty);
1821             }
1822             set
1823             {
1824                 SetValue(ScaleProperty, value);
1825                 NotifyPropertyChanged();
1826             }
1827         }
1828
1829         /// <summary>
1830         /// Gets or sets the scale X factor applied to the view.
1831         /// </summary>
1832         /// <remarks>
1833         /// <para>
1834         /// Animatable - This property can be animated using <c>Animation</c> class.
1835         /// <code>
1836         /// animation.AnimateTo(view, "ScaleX", 1.5f);
1837         /// </code>
1838         /// </para>
1839         /// </remarks>
1840         /// <since_tizen> 3 </since_tizen>
1841         public float ScaleX
1842         {
1843             get
1844             {
1845                 return (float)GetValue(ScaleXProperty);
1846             }
1847             set
1848             {
1849                 SetValue(ScaleXProperty, value);
1850                 NotifyPropertyChanged();
1851             }
1852         }
1853
1854         /// <summary>
1855         /// Gets or sets the scale Y factor applied to the view.
1856         /// </summary>
1857         /// <remarks>
1858         /// <para>
1859         /// Animatable - This property can be animated using <c>Animation</c> class.
1860         /// <code>
1861         /// animation.AnimateTo(view, "ScaleY", 1.5f);
1862         /// </code>
1863         /// </para>
1864         /// </remarks>
1865         /// <since_tizen> 3 </since_tizen>
1866         public float ScaleY
1867         {
1868             get
1869             {
1870                 return (float)GetValue(ScaleYProperty);
1871             }
1872             set
1873             {
1874                 SetValue(ScaleYProperty, value);
1875                 NotifyPropertyChanged();
1876             }
1877         }
1878
1879         /// <summary>
1880         /// Gets or sets the scale Z factor applied to the view.
1881         /// </summary>
1882         /// <remarks>
1883         /// <para>
1884         /// Animatable - This property can be animated using <c>Animation</c> class.
1885         /// <code>
1886         /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1887         /// </code>
1888         /// </para>
1889         /// </remarks>
1890         /// <since_tizen> 3 </since_tizen>
1891         public float ScaleZ
1892         {
1893             get
1894             {
1895                 return (float)GetValue(ScaleZProperty);
1896             }
1897             set
1898             {
1899                 SetValue(ScaleZProperty, value);
1900                 NotifyPropertyChanged();
1901             }
1902         }
1903
1904         /// <summary>
1905         /// Gets the world scale of the view.
1906         /// </summary>
1907         /// <since_tizen> 3 </since_tizen>
1908         public Vector3 WorldScale
1909         {
1910             get
1911             {
1912                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1913                 var pValue = GetProperty(View.Property.WorldScale);
1914                 pValue.Get(temp);
1915                 pValue.Dispose();
1916                 return temp;
1917             }
1918         }
1919
1920         /// <summary>
1921         /// Retrieves the visibility flag of the view.
1922         /// </summary>
1923         /// <remarks>
1924         /// <para>
1925         /// If the view is not visible, then the view and its children will not be rendered.
1926         /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true.
1927         /// </para>
1928         /// <para>
1929         /// Animatable - This property can be animated using <c>Animation</c> class.
1930         /// <code>
1931         /// animation.AnimateTo(view, "Visibility", false);
1932         /// </code>
1933         /// </para>
1934         /// </remarks>
1935         /// <since_tizen> 3 </since_tizen>
1936         public bool Visibility
1937         {
1938             get
1939             {
1940                 bool temp = false;
1941                 var pValue = GetProperty(View.Property.VISIBLE);
1942                 pValue.Get(out temp);
1943                 pValue.Dispose();
1944                 return temp;
1945             }
1946         }
1947
1948         /// <summary>
1949         /// Gets the view's world color.
1950         /// </summary>
1951         /// <since_tizen> 3 </since_tizen>
1952         public Vector4 WorldColor
1953         {
1954             get
1955             {
1956                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1957                 var pValue = GetProperty(View.Property.WorldColor);
1958                 pValue.Get(temp);
1959                 pValue.Dispose();
1960                 return temp;
1961             }
1962         }
1963
1964         /// <summary>
1965         /// Gets or sets the view's name.
1966         /// </summary>
1967         /// <since_tizen> 3 </since_tizen>
1968         public string Name
1969         {
1970             get
1971             {
1972                 return (string)GetValue(NameProperty);
1973             }
1974             set
1975             {
1976                 SetValue(NameProperty, value);
1977                 NotifyPropertyChanged();
1978             }
1979         }
1980
1981         /// <summary>
1982         /// Get the number of children held by the view.
1983         /// </summary>
1984         /// <since_tizen> 3 </since_tizen>
1985         public new uint ChildCount
1986         {
1987             get
1988             {
1989                 return Convert.ToUInt32(Children.Count);
1990             }
1991         }
1992
1993         /// <summary>
1994         /// Gets the view's ID.
1995         /// Read-only
1996         /// </summary>
1997         /// <since_tizen> 3 </since_tizen>
1998         public uint ID
1999         {
2000             get
2001             {
2002                 return GetId();
2003             }
2004         }
2005
2006         /// <summary>
2007         /// Gets or sets the status of whether the view should emit touch or hover signals.
2008         /// If a View is made insensitive, then the View and its children are not hittable.
2009         /// </summary>
2010         /// <since_tizen> 3 </since_tizen>
2011         public bool Sensitive
2012         {
2013             get
2014             {
2015                 return (bool)GetValue(SensitiveProperty);
2016             }
2017             set
2018             {
2019                 SetValue(SensitiveProperty, value);
2020                 NotifyPropertyChanged();
2021             }
2022         }
2023
2024         /// <summary>
2025         /// Gets or sets the status of whether the view should be enabled user interactions.
2026         /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2027         /// </summary>
2028         /// <since_tizen> tizen_next </since_tizen>
2029         [EditorBrowsable(EditorBrowsableState.Never)]
2030         public bool IsEnabled
2031         {
2032             get
2033             {
2034                 return (bool)GetValue(IsEnabledProperty);
2035             }
2036             set
2037             {
2038                 SetValue(IsEnabledProperty, value);
2039                 NotifyPropertyChanged();
2040             }
2041         }
2042
2043         /// <summary>
2044         /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view.
2045         /// </summary>
2046         /// <since_tizen> 3 </since_tizen>
2047         public bool LeaveRequired
2048         {
2049             get
2050             {
2051                 return (bool)GetValue(LeaveRequiredProperty);
2052             }
2053             set
2054             {
2055                 SetValue(LeaveRequiredProperty, value);
2056                 NotifyPropertyChanged();
2057             }
2058         }
2059
2060         /// <summary>
2061         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2062         /// </summary>
2063         /// <since_tizen> 3 </since_tizen>
2064         public bool InheritOrientation
2065         {
2066             get
2067             {
2068                 return (bool)GetValue(InheritOrientationProperty);
2069             }
2070             set
2071             {
2072                 SetValue(InheritOrientationProperty, value);
2073                 NotifyPropertyChanged();
2074             }
2075         }
2076
2077         /// <summary>
2078         /// Gets or sets the status of whether a child view inherits it's parent's scale.
2079         /// </summary>
2080         /// <since_tizen> 3 </since_tizen>
2081         public bool InheritScale
2082         {
2083             get
2084             {
2085                 return (bool)GetValue(InheritScaleProperty);
2086             }
2087             set
2088             {
2089                 SetValue(InheritScaleProperty, value);
2090                 NotifyPropertyChanged();
2091             }
2092         }
2093
2094         /// <summary>
2095         /// Gets or sets the status of how the view and its children should be drawn.<br />
2096         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2097         /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.<br />
2098         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2099         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2100         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2101         /// </summary>
2102         /// <since_tizen> 3 </since_tizen>
2103         public DrawModeType DrawMode
2104         {
2105             get
2106             {
2107                 return (DrawModeType)GetValue(DrawModeProperty);
2108             }
2109             set
2110             {
2111                 SetValue(DrawModeProperty, value);
2112                 NotifyPropertyChanged();
2113             }
2114         }
2115
2116         /// <summary>
2117         /// Gets or sets the relative to parent size factor of the view.<br />
2118         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2119         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2120         /// </summary>
2121         /// <remarks>
2122         /// The property cascade chaining set is not recommended.
2123         /// </remarks>
2124         /// <example>
2125         /// This way is recommended for setting the property
2126         /// <code>
2127         /// var text = new TextField();
2128         /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2129         /// </code>
2130         /// This way to set the property is prohibited
2131         /// <code>
2132         /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2133         /// </code>
2134         /// </example>
2135         /// <since_tizen> 3 </since_tizen>
2136         public Vector3 SizeModeFactor
2137         {
2138             get
2139             {
2140                 return (Vector3)GetValue(SizeModeFactorProperty);
2141             }
2142             set
2143             {
2144                 SetValue(SizeModeFactorProperty, value);
2145                 NotifyPropertyChanged();
2146             }
2147         }
2148
2149         /// <summary>
2150         /// Gets or sets the width resize policy to be used.
2151         /// </summary>
2152         /// <since_tizen> 3 </since_tizen>
2153         public ResizePolicyType WidthResizePolicy
2154         {
2155             get
2156             {
2157                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2158             }
2159             set
2160             {
2161                 SetValue(WidthResizePolicyProperty, value);
2162                 NotifyPropertyChanged();
2163             }
2164         }
2165
2166         /// <summary>
2167         /// Gets or sets the height resize policy to be used.
2168         /// </summary>
2169         /// <since_tizen> 3 </since_tizen>
2170         public ResizePolicyType HeightResizePolicy
2171         {
2172             get
2173             {
2174                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2175             }
2176             set
2177             {
2178                 SetValue(HeightResizePolicyProperty, value);
2179                 NotifyPropertyChanged();
2180             }
2181         }
2182
2183         /// <summary>
2184         /// Gets or sets the policy to use when setting size with size negotiation.<br />
2185         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2186         /// </summary>
2187         /// <since_tizen> 3 </since_tizen>
2188         public SizeScalePolicyType SizeScalePolicy
2189         {
2190             get
2191             {
2192                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2193             }
2194             set
2195             {
2196                 SetValue(SizeScalePolicyProperty, value);
2197                 NotifyPropertyChanged();
2198             }
2199         }
2200
2201         /// <summary>
2202         ///  Gets or sets the status of whether the width size is dependent on the height size.
2203         /// </summary>
2204         /// <since_tizen> 3 </since_tizen>
2205         public bool WidthForHeight
2206         {
2207             get
2208             {
2209                 return (bool)GetValue(WidthForHeightProperty);
2210             }
2211             set
2212             {
2213                 SetValue(WidthForHeightProperty, value);
2214                 NotifyPropertyChanged();
2215             }
2216         }
2217
2218         /// <summary>
2219         /// Gets or sets the status of whether the height size is dependent on the width size.
2220         /// </summary>
2221         /// <since_tizen> 3 </since_tizen>
2222         public bool HeightForWidth
2223         {
2224             get
2225             {
2226                 return (bool)GetValue(HeightForWidthProperty);
2227             }
2228             set
2229             {
2230                 SetValue(HeightForWidthProperty, value);
2231                 NotifyPropertyChanged();
2232             }
2233         }
2234
2235         /// <summary>
2236         /// Gets or sets the padding for use in layout.
2237         /// </summary>
2238         /// <remarks>
2239         /// The property cascade chaining set is not recommended.
2240         /// </remarks>
2241         /// <example>
2242         /// This way is recommended for setting the property
2243         /// <code>
2244         /// var view = new View();
2245         /// view.Padding = new Extents(5, 5, 5, 5);
2246         /// </code>
2247         /// This way to set the property is prohibited
2248         /// <code>
2249         /// view.Padding.Start = 5; //This does not guarantee a proper operation
2250         /// </code>
2251         /// </example>
2252         /// <since_tizen> 5 </since_tizen>
2253         public Extents Padding
2254         {
2255             get
2256             {
2257                 return (Extents)GetValue(PaddingProperty);
2258             }
2259             set
2260             {
2261                 SetValue(PaddingProperty, value);
2262                 NotifyPropertyChanged();
2263             }
2264         }
2265
2266         /// <summary>
2267         /// Gets or sets the minimum size the view can be assigned in size negotiation.
2268         /// </summary>
2269         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2270         /// <remarks>
2271         /// The property cascade chaining set is not recommended.
2272         /// </remarks>
2273         /// <example>
2274         /// This way is recommended for setting the property
2275         /// <code>
2276         /// var view = new View();
2277         /// view.MinimumSize = new Size2D(100, 200);
2278         /// </code>
2279         /// This way to set the property is prohibited
2280         /// <code>
2281         /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2282         /// </code>
2283         /// </example>
2284         /// <since_tizen> 3 </since_tizen>
2285         public Size2D MinimumSize
2286         {
2287             get
2288             {
2289                 return (Size2D)GetValue(MinimumSizeProperty);
2290             }
2291             set
2292             {
2293                 if (value == null)
2294                 {
2295                     throw new ArgumentNullException(nameof(value));
2296                 }
2297                 if (layout != null)
2298                 {
2299                     // Note: it only works if minimum size is >= than natural size.
2300                     // To force the size it should be done through the width&height spec or Size2D.
2301                     layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2302                     layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2303                     layout.RequestLayout();
2304                 }
2305                 SetValue(MinimumSizeProperty, value);
2306                 NotifyPropertyChanged();
2307             }
2308         }
2309
2310         /// <summary>
2311         /// Gets or sets the maximum size the view can be assigned in size negotiation.
2312         /// </summary>
2313         /// <example>
2314         /// This way is recommended for setting the property
2315         /// <code>
2316         /// var view = new View();
2317         /// view.MaximumSize = new Size2D(100, 200);
2318         /// </code>
2319         /// This way to set the property is prohibited
2320         /// <code>
2321         /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2322         /// </code>
2323         /// </example>
2324         /// <since_tizen> 3 </since_tizen>
2325         public Size2D MaximumSize
2326         {
2327             get
2328             {
2329                 return (Size2D)GetValue(MaximumSizeProperty);
2330             }
2331             set
2332             {
2333                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2334                 // MATCH_PARENT spec + parent container size can be used to limit
2335                 if (layout != null)
2336                 {
2337                     layout.RequestLayout();
2338                 }
2339                 SetValue(MaximumSizeProperty, value);
2340                 NotifyPropertyChanged();
2341             }
2342         }
2343
2344         /// <summary>
2345         /// Gets or sets whether a child view inherits it's parent's position.<br />
2346         /// Default is to inherit.<br />
2347         /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.<br />
2348         /// </summary>
2349         /// <since_tizen> 3 </since_tizen>
2350         public bool InheritPosition
2351         {
2352             get
2353             {
2354                 return (bool)GetValue(InheritPositionProperty);
2355             }
2356             set
2357             {
2358                 SetValue(InheritPositionProperty, value);
2359                 NotifyPropertyChanged();
2360             }
2361         }
2362
2363         /// <summary>
2364         /// Gets or sets the clipping behavior (mode) of it's children.
2365         /// </summary>
2366         /// <since_tizen> 3 </since_tizen>
2367         public ClippingModeType ClippingMode
2368         {
2369             get
2370             {
2371                 return (ClippingModeType)GetValue(ClippingModeProperty);
2372             }
2373             set
2374             {
2375                 SetValue(ClippingModeProperty, value);
2376                 NotifyPropertyChanged();
2377             }
2378         }
2379
2380         /// <summary>
2381         /// Gets the number of renderers held by the view.
2382         /// </summary>
2383         /// <since_tizen> 3 </since_tizen>
2384         public uint RendererCount
2385         {
2386             get
2387             {
2388                 return GetRendererCount();
2389             }
2390         }
2391
2392         /// <summary>
2393         /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2394         /// </summary>
2395         /// <remarks>
2396         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2397         /// </remarks>
2398         /// <since_tizen> 3 </since_tizen>
2399         [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2400             "Like: " +
2401             "View view = new View(); " +
2402             "view.PivotPoint = PivotPoint.Center; " +
2403             "view.PositionUsesPivotPoint = true;")]
2404         [EditorBrowsable(EditorBrowsableState.Never)]
2405         public Position AnchorPoint
2406         {
2407             get
2408             {
2409                 return GetValue(AnchorPointProperty) as Position;
2410             }
2411             set
2412             {
2413                 SetValue(AnchorPointProperty, value);
2414             }
2415         }
2416
2417         private Position InternalAnchorPoint
2418         {
2419             get
2420             {
2421                 Position temp = new Position(0.0f, 0.0f, 0.0f);
2422                 var pValue = GetProperty(View.Property.AnchorPoint);
2423                 pValue.Get(temp);
2424                 pValue.Dispose();
2425                 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2426                 temp.Dispose();
2427                 return ret;
2428             }
2429             set
2430             {
2431                 var temp = new Tizen.NUI.PropertyValue(value);
2432                 SetProperty(View.Property.AnchorPoint, temp);
2433                 temp.Dispose();
2434                 NotifyPropertyChanged();
2435             }
2436         }
2437
2438         /// <summary>
2439         /// Sets the size of a view for the width, the height and the depth.<br />
2440         /// Geometry can be scaled to fit within this area.<br />
2441         /// This does not interfere with the view's scale factor.<br />
2442         /// The views default depth is the minimum of width and height.<br />
2443         /// </summary>
2444         /// <remarks>
2445         /// <para>
2446         /// Animatable - This property can be animated using <c>Animation</c> class.
2447         /// <code>
2448         /// animation.AnimateTo(view, "Size", new Size(100, 100));
2449         /// </code>
2450         /// </para>
2451         /// The property cascade chaining set is not recommended.
2452         /// </remarks>
2453         /// <example>
2454         /// This way is recommended for setting the property
2455         /// <code>
2456         /// var view = new View();
2457         /// view.Size = new Size(100.5f, 200, 0);
2458         /// </code>
2459         /// This way to set the property is prohibited
2460         /// <code>
2461         /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2462         /// </code>
2463         /// </example>
2464         /// <since_tizen> 5 </since_tizen>
2465         public Size Size
2466         {
2467             get
2468             {
2469                 return (Size)GetValue(SizeProperty);
2470             }
2471             set
2472             {
2473                 SetValue(SizeProperty, value);
2474                 NotifyPropertyChanged();
2475             }
2476         }
2477
2478         /// <summary>
2479         /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2480         /// </summary>
2481         /// <since_tizen> 3 </since_tizen>
2482         [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2483             "Like: " +
2484             "Container parent =  view.GetParent(); " +
2485             "View view = parent as View;")]
2486         [EditorBrowsable(EditorBrowsableState.Never)]
2487         public new View Parent
2488         {
2489             get
2490             {
2491                 View ret;
2492                 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2493                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2494                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2495
2496                 if (basehandle is Layer layer)
2497                 {
2498                     ret = new View(Layer.getCPtr(layer).Handle, false);
2499                     NUILog.Error("This Parent property is deprecated, should do not be used");
2500                 }
2501                 else
2502                 {
2503                     ret = basehandle as View;
2504                 }
2505
2506                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2507                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2508
2509                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2510                 return ret;
2511             }
2512         }
2513
2514         /// <summary>
2515         /// Gets/Sets whether inherit parent's the layout Direction.
2516         /// </summary>
2517         /// <since_tizen> 4 </since_tizen>
2518         public bool InheritLayoutDirection
2519         {
2520             get
2521             {
2522                 return (bool)GetValue(InheritLayoutDirectionProperty);
2523             }
2524             set
2525             {
2526                 SetValue(InheritLayoutDirectionProperty, value);
2527                 NotifyPropertyChanged();
2528             }
2529         }
2530
2531         /// <summary>
2532         /// Gets/Sets the layout Direction.
2533         /// </summary>
2534         /// <since_tizen> 4 </since_tizen>
2535         public ViewLayoutDirectionType LayoutDirection
2536         {
2537             get
2538             {
2539                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2540             }
2541             set
2542             {
2543                 SetValue(LayoutDirectionProperty, value);
2544                 NotifyPropertyChanged();
2545                 layout?.RequestLayout();
2546             }
2547         }
2548
2549         /// <summary>
2550         /// Gets or sets the Margin for use in layout.
2551         /// </summary>
2552         /// <remarks>
2553         /// Margin property is supported by Layout algorithms and containers.
2554         /// Please Set Layout if you want to use Margin property.
2555         /// The property cascade chaining set is not recommended.
2556         /// </remarks>
2557         /// <example>
2558         /// This way is recommended for setting the property
2559         /// <code>
2560         /// var view = new View();
2561         /// view.Margin = new Extents(10, 5, 15, 20);
2562         /// </code>
2563         /// This way to set the property is prohibited
2564         /// <code>
2565         /// view.Margin.Top = 15; //This does not guarantee a proper operation
2566         /// </code>
2567         /// </example>
2568         /// <since_tizen> 4 </since_tizen>
2569         public Extents Margin
2570         {
2571             get
2572             {
2573                 return (Extents)GetValue(MarginProperty);
2574             }
2575             set
2576             {
2577                 SetValue(MarginProperty, value);
2578                 NotifyPropertyChanged();
2579             }
2580         }
2581
2582         ///<summary>
2583         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2584         ///</summary>
2585         /// <example>
2586         /// <code>
2587         /// // matchParentView matches its size to its parent size.
2588         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2589         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2590         ///
2591         /// // wrapContentView wraps its children with their desired size.
2592         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2593         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2594         ///
2595         /// // exactSizeView shows itself with an exact size.
2596         /// exactSizeView.WidthSpecification = 100;
2597         /// exactSizeView.HeightSpecification = 100;
2598         /// </code>
2599         /// </example>
2600         /// <since_tizen> 6 </since_tizen>
2601         [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2602         public int WidthSpecification
2603         {
2604             get
2605             {
2606                 return (int)GetValue(WidthSpecificationProperty);
2607             }
2608             set
2609             {
2610                 SetValue(WidthSpecificationProperty, value);
2611                 NotifyPropertyChanged();
2612             }
2613         }
2614
2615         private int InternalWidthSpecification
2616         {
2617             get
2618             {
2619                 return widthPolicy;
2620             }
2621             set
2622             {
2623                 if (value == widthPolicy)
2624                     return;
2625
2626                 widthPolicy = value;
2627                 if (widthPolicy >= 0)
2628                 {
2629                     if (heightPolicy >= 0) // Policy an exact value
2630                     {
2631                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2632                         Size2D = new Size2D(widthPolicy, heightPolicy);
2633                     }
2634                 }
2635                 layout?.RequestLayout();
2636             }
2637         }
2638
2639         ///<summary>
2640         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2641         ///</summary>
2642         /// <example>
2643         /// <code>
2644         /// // matchParentView matches its size to its parent size.
2645         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2646         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2647         ///
2648         /// // wrapContentView wraps its children with their desired size.
2649         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2650         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2651         ///
2652         /// // exactSizeView shows itself with an exact size.
2653         /// exactSizeView.WidthSpecification = 100;
2654         /// exactSizeView.HeightSpecification = 100;
2655         /// </code>
2656         /// </example>
2657         /// <since_tizen> 6 </since_tizen>
2658         [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2659         public int HeightSpecification
2660         {
2661             get
2662             {
2663                 return (int)GetValue(HeightSpecificationProperty);
2664             }
2665             set
2666             {
2667                 SetValue(HeightSpecificationProperty, value);
2668                 NotifyPropertyChanged();
2669             }
2670         }
2671
2672         private int InternalHeightSpecification
2673         {
2674             get
2675             {
2676                 return heightPolicy;
2677             }
2678             set
2679             {
2680                 if (value == heightPolicy)
2681                     return;
2682
2683                 heightPolicy = value;
2684                 if (heightPolicy >= 0)
2685                 {
2686                     if (widthPolicy >= 0) // Policy an exact value
2687                     {
2688                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2689                         Size2D = new Size2D(widthPolicy, heightPolicy);
2690                     }
2691                 }
2692                 layout?.RequestLayout();
2693             }
2694         }
2695
2696         ///<summary>
2697         /// Gets the List of transitions for this View.
2698         ///</summary>
2699         /// <since_tizen> 6 </since_tizen>
2700         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2701         {
2702             get
2703             {
2704                 if (layoutTransitions == null)
2705                 {
2706                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2707                 }
2708                 return layoutTransitions;
2709             }
2710         }
2711
2712         ///<summary>
2713         /// Sets a layout transitions for this View.
2714         ///</summary>
2715         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2716         /// <remarks>
2717         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2718         /// </remarks>
2719         /// <since_tizen> 6 </since_tizen>
2720         public LayoutTransition LayoutTransition
2721         {
2722             get
2723             {
2724                 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2725             }
2726             set
2727             {
2728                 SetValue(LayoutTransitionProperty, value);
2729                 NotifyPropertyChanged();
2730             }
2731         }
2732
2733         private LayoutTransition InternalLayoutTransition
2734         {
2735             get
2736             {
2737                 return layoutTransition;
2738             }
2739             set
2740             {
2741                 if (value == null)
2742                 {
2743                     throw new global::System.ArgumentNullException(nameof(value));
2744                 }
2745                 if (layoutTransitions == null)
2746                 {
2747                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2748                 }
2749
2750                 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2751
2752                 AttachTransitionsToChildren(value);
2753
2754                 layoutTransition = value;
2755             }
2756         }
2757
2758         /// <summary>
2759         /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2760         /// </summary>
2761         /// <remarks>
2762         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2763         /// </remarks>
2764         /// <since_tizen> 4 </since_tizen>
2765         [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2766         [EditorBrowsable(EditorBrowsableState.Never)]
2767         public Extents PaddingEX
2768         {
2769             get
2770             {
2771                 return GetValue(PaddingEXProperty) as Extents;
2772             }
2773             set
2774             {
2775                 SetValue(PaddingEXProperty, value);
2776             }
2777         }
2778
2779         private Extents InternalPaddingEX
2780         {
2781             get
2782             {
2783                 Extents temp = new Extents(0, 0, 0, 0);
2784                 var pValue = GetProperty(View.Property.PADDING);
2785                 pValue.Get(temp);
2786                 pValue.Dispose();
2787                 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2788                 temp.Dispose();
2789                 return ret;
2790             }
2791             set
2792             {
2793                 var temp = new Tizen.NUI.PropertyValue(value);
2794                 SetProperty(View.Property.PADDING, temp);
2795                 temp.Dispose();
2796                 NotifyPropertyChanged();
2797                 layout?.RequestLayout();
2798             }
2799         }
2800
2801         /// <summary>
2802         /// The Color of View. This is an RGBA value.
2803         /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2804         /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2805         /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2806         /// Inherient of color value depend on <see cref="ColorMode"/>.
2807         /// </summary>
2808         /// <remarks>
2809         /// <para>
2810         /// Animatable - This property can be animated using <c>Animation</c> class.
2811         /// </para>
2812         /// The property cascade chaining set is not recommended.
2813         /// </remarks>
2814         /// <example>
2815         /// This way is recommended for setting the property
2816         /// <code>
2817         /// var view = new View();
2818         /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2819         /// </code>
2820         /// This way to set the property is prohibited
2821         /// <code>
2822         /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2823         /// </code>
2824         /// </example>
2825         [EditorBrowsable(EditorBrowsableState.Never)]
2826         public Color Color
2827         {
2828             get
2829             {
2830                 return (Color)GetValue(ColorProperty);
2831             }
2832             set
2833             {
2834                 SetValue(ColorProperty, value);
2835                 NotifyPropertyChanged();
2836             }
2837         }
2838
2839         /// <summary>
2840         /// The Red component of View.Color.
2841         /// </summary>
2842         /// <remarks>
2843         /// <para>
2844         /// Animatable - This property can be animated using <c>Animation</c> class.
2845         /// </para>
2846         /// </remarks>
2847         [EditorBrowsable(EditorBrowsableState.Never)]
2848         public float ColorRed
2849         {
2850             get
2851             {
2852                 return (float)GetValue(ColorRedProperty);
2853             }
2854             set
2855             {
2856                 SetValue(ColorRedProperty, value);
2857                 NotifyPropertyChanged();
2858             }
2859         }
2860
2861         /// <summary>
2862         /// The Green component of View.Color.
2863         /// </summary>
2864         /// <remarks>
2865         /// <para>
2866         /// Animatable - This property can be animated using <c>Animation</c> class.
2867         /// </para>
2868         /// </remarks>
2869         [EditorBrowsable(EditorBrowsableState.Never)]
2870         public float ColorGreen
2871         {
2872             get
2873             {
2874                 return (float)GetValue(ColorGreenProperty);
2875             }
2876             set
2877             {
2878                 SetValue(ColorGreenProperty, value);
2879                 NotifyPropertyChanged();
2880             }
2881         }
2882
2883         /// <summary>
2884         /// The Blue component of View.Color.
2885         /// </summary>
2886         /// <remarks>
2887         /// <para>
2888         /// Animatable - This property can be animated using <c>Animation</c> class.
2889         /// </para>
2890         /// </remarks>
2891         [EditorBrowsable(EditorBrowsableState.Never)]
2892         public float ColorBlue
2893         {
2894             get
2895             {
2896                 return (float)GetValue(ColorBlueProperty);
2897             }
2898             set
2899             {
2900                 SetValue(ColorBlueProperty, value);
2901                 NotifyPropertyChanged();
2902             }
2903         }
2904
2905         /// <summary>
2906         /// Set the layout on this View. Replaces any existing Layout.
2907         /// </summary>
2908         /// <remarks>
2909         /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2910         /// </remarks>
2911         /// <since_tizen> 6 </since_tizen>
2912         public LayoutItem Layout
2913         {
2914             get
2915             {
2916                 return GetValue(LayoutProperty) as LayoutItem;
2917             }
2918             set
2919             {
2920                 SetValue(LayoutProperty, value);
2921             }
2922         }
2923
2924         private LayoutItem InternalLayout
2925         {
2926             get
2927             {
2928                 return layout;
2929             }
2930             set
2931             {
2932                 // Do nothing if layout provided is already set on this View.
2933                 if (value == layout)
2934                 {
2935                     return;
2936                 }
2937
2938                 LayoutingDisabled = false;
2939                 layoutSet = true;
2940
2941                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2942                 // First check if the layout to be set already has a owner.
2943                 if (value?.Owner != null)
2944                 {
2945                     // Previous owner of the layout gets a default layout as a replacement.
2946                     value.Owner.Layout = new AbsoluteLayout()
2947                     {
2948                         // Copy Margin and Padding to replacement LayoutGroup.
2949                         Margin = value.Margin,
2950                         Padding = value.Padding,
2951                     };
2952                 }
2953
2954                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2955                 // View if no replacement. Previously margin and padding values would have been moved from
2956                 // the View to the layout.
2957                 if (layout != null) // Existing layout
2958                 {
2959                     if (value != null)
2960                     {
2961                         // Existing layout being replaced so copy over margin and padding values.
2962                         value.Margin = layout.Margin;
2963                         value.Padding = layout.Padding;
2964                         value.SetPositionByLayout = !excludeLayouting;
2965                     }
2966                     else
2967                     {
2968                         // Layout not being replaced so restore margin and padding to View.
2969                         SetValue(MarginProperty, layout.Margin);
2970                         SetValue(PaddingProperty, layout.Padding);
2971                         NotifyPropertyChanged();
2972                     }
2973                 }
2974                 else
2975                 {
2976                     // First Layout to be added to the View hence copy
2977
2978                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2979                     if (value != null)
2980                     {
2981                         Extents margin = Margin;
2982                         Extents padding = Padding;
2983                         bool setMargin = false;
2984                         bool setPadding = false;
2985
2986                         if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2987                         {
2988                             // If View already has a margin set then store it in Layout instead.
2989                             value.Margin = margin;
2990                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2991                             setMargin = true;
2992                         }
2993
2994                         if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2995                         {
2996                             // If View already has a padding set then store it in Layout instead.
2997                             value.Padding = padding;
2998                             SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2999                             setPadding = true;
3000                         }
3001
3002                         if (setMargin || setPadding)
3003                         {
3004                             NotifyPropertyChanged();
3005                         }
3006
3007                         value.SetPositionByLayout = !excludeLayouting;
3008                     }
3009                 }
3010
3011                 // Remove existing layout from it's parent layout group.
3012                 layout?.Unparent();
3013
3014                 // Set layout to this view
3015                 SetLayout(value);
3016             }
3017         }
3018
3019         /// <summary>
3020         /// The weight of the View, used to share available space in a layout with siblings.
3021         /// </summary>
3022         /// <since_tizen> 6 </since_tizen>
3023         public float Weight
3024         {
3025             get
3026             {
3027                 return weight;
3028             }
3029             set
3030             {
3031                 weight = value;
3032                 layout?.RequestLayout();
3033             }
3034         }
3035
3036         /// <summary>
3037         ///  Whether to load the BackgroundImage synchronously.
3038         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3039         ///  Note: For Normal Quad images only.
3040         /// </summary>
3041         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3042         [EditorBrowsable(EditorBrowsableState.Never)]
3043         public bool BackgroundImageSynchronosLoading
3044         {
3045             get
3046             {
3047                 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3048             }
3049             set
3050             {
3051                 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3052                 NotifyPropertyChanged();
3053             }
3054         }
3055
3056         private bool InternalBackgroundImageSynchronosLoading
3057         {
3058             get
3059             {
3060                 return BackgroundImageSynchronousLoading;
3061             }
3062             set
3063             {
3064                 BackgroundImageSynchronousLoading = value;
3065             }
3066         }
3067
3068         /// <summary>
3069         ///  Whether to load the BackgroundImage synchronously.
3070         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3071         ///  Note: For Normal Quad images only.
3072         /// </summary>
3073         /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3074         [EditorBrowsable(EditorBrowsableState.Never)]
3075         public bool BackgroundImageSynchronousLoading
3076         {
3077             get
3078             {
3079                 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3080             }
3081             set
3082             {
3083                 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3084                 NotifyPropertyChanged();
3085             }
3086         }
3087
3088         private bool InternalBackgroundImageSynchronousLoading
3089         {
3090             get
3091             {
3092                 return backgroundImageSynchronousLoading;
3093             }
3094             set
3095             {
3096                 backgroundImageSynchronousLoading = value;
3097
3098                 string bgUrl = null;
3099                 var pValue = Background.Find(ImageVisualProperty.URL);
3100                 pValue?.Get(out bgUrl);
3101                 pValue?.Dispose();
3102
3103                 if (!string.IsNullOrEmpty(bgUrl))
3104                 {
3105                     PropertyMap bgMap = this.Background;
3106                     var temp = new PropertyValue(backgroundImageSynchronousLoading);
3107                     bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3108                     temp.Dispose();
3109                     Background = bgMap;
3110                 }
3111             }
3112         }
3113
3114         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3115         [EditorBrowsable(EditorBrowsableState.Never)]
3116         public Vector4 UpdateAreaHint
3117         {
3118             get
3119             {
3120                 return (Vector4)GetValue(UpdateAreaHintProperty);
3121             }
3122             set
3123             {
3124                 SetValue(UpdateAreaHintProperty, value);
3125                 NotifyPropertyChanged();
3126             }
3127         }
3128
3129         /// <summary>
3130         /// Enable/Disable ControlState propagation for children.
3131         /// It is false by default.
3132         /// If the View needs to share ControlState with descendants, please set it true.
3133         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3134         /// </summary>
3135         [EditorBrowsable(EditorBrowsableState.Never)]
3136         public bool EnableControlStatePropagation
3137         {
3138             get
3139             {
3140                 return (bool)GetValue(EnableControlStatePropagationProperty);
3141             }
3142             set
3143             {
3144                 SetValue(EnableControlStatePropagationProperty, value);
3145                 NotifyPropertyChanged();
3146             }
3147         }
3148
3149         private bool InternalEnableControlStatePropagation
3150         {
3151             get => themeData?.ControlStatePropagation ?? false;
3152             set
3153             {
3154                 if (InternalEnableControlStatePropagation == value) return;
3155
3156                 if (themeData == null) themeData = new ThemeData();
3157
3158                 themeData.ControlStatePropagation = value;
3159
3160                 foreach (View child in Children)
3161                 {
3162                     child.EnableControlStatePropagation = value;
3163                 }
3164             }
3165         }
3166
3167         /// <summary>
3168         /// The ControlStates can propagate from the parent.
3169         /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3170         /// if parent view EnableControlState is true.
3171         /// <see cref="EnableControlState"/>.
3172         /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3173         /// </summary>
3174         [EditorBrowsable(EditorBrowsableState.Never)]
3175         public ControlState PropagatableControlStates
3176         {
3177             get
3178             {
3179                 return (ControlState)GetValue(PropagatableControlStatesProperty);
3180             }
3181             set
3182             {
3183                 SetValue(PropagatableControlStatesProperty, value);
3184                 NotifyPropertyChanged();
3185             }
3186         }
3187
3188         private ControlState InternalPropagatableControlStates
3189         {
3190             get => propagatableControlStates;
3191             set => propagatableControlStates = value;
3192         }
3193
3194         /// <summary>
3195         /// By default, it is false in View, true in Control.
3196         /// Note that if the value is true, the View will be a touch receptor.
3197         /// </summary>
3198         [EditorBrowsable(EditorBrowsableState.Never)]
3199         public bool EnableControlState
3200         {
3201             get
3202             {
3203                 return (bool)GetValue(EnableControlStateProperty);
3204             }
3205             set
3206             {
3207                 SetValue(EnableControlStateProperty, value);
3208             }
3209         }
3210
3211         /// <summary>
3212         /// Whether the actor grab all touches even if touch leaves its boundary.
3213         /// </summary>
3214         /// <returns>true, if it grab all touch after start</returns>
3215         [EditorBrowsable(EditorBrowsableState.Never)]
3216         public bool GrabTouchAfterLeave
3217         {
3218             get
3219             {
3220                 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3221             }
3222             set
3223             {
3224                 SetValue(GrabTouchAfterLeaveProperty, value);
3225             }
3226         }
3227
3228         private bool InternalGrabTouchAfterLeave
3229         {
3230             get
3231             {
3232                 bool temp = false;
3233                 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3234                 pValue.Get(out temp);
3235                 pValue.Dispose();
3236                 return temp;
3237             }
3238             set
3239             {
3240                 var temp = new Tizen.NUI.PropertyValue(value);
3241                 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3242                 temp.Dispose();
3243                 NotifyPropertyChanged();
3244             }
3245         }
3246
3247         /// <summary>
3248         /// Whether the view will only receive own touch.
3249         /// </summary>
3250         /// <returns>true, if it only receives touches that started from itself.</returns>
3251         [EditorBrowsable(EditorBrowsableState.Never)]
3252         public bool AllowOnlyOwnTouch
3253         {
3254             get
3255             {
3256                 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3257             }
3258             set
3259             {
3260                 SetValue(AllowOnlyOwnTouchProperty, value);
3261             }
3262         }
3263
3264         private bool InternalAllowOnlyOwnTouch
3265         {
3266             get
3267             {
3268                 bool temp = false;
3269                 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3270                 pValue.Get(out temp);
3271                 pValue.Dispose();
3272                 return temp;
3273             }
3274             set
3275             {
3276                 var temp = new Tizen.NUI.PropertyValue(value);
3277                 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3278                 temp.Dispose();
3279                 NotifyPropertyChanged();
3280             }
3281         }
3282
3283         /// <summary>
3284         /// Determines which blend equation will be used to render renderers of this actor.
3285         /// </summary>
3286         /// <returns>blend equation enum currently assigned</returns>
3287         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3288         [EditorBrowsable(EditorBrowsableState.Never)]
3289         public BlendEquationType BlendEquation
3290         {
3291             get
3292             {
3293                 return (BlendEquationType)GetValue(BlendEquationProperty);
3294             }
3295             set
3296             {
3297                 SetValue(BlendEquationProperty, value);
3298             }
3299         }
3300
3301         private BlendEquationType InternalBlendEquation
3302         {
3303             get
3304             {
3305                 int temp = 0;
3306                 var pValue = GetProperty(View.Property.BlendEquation);
3307                 pValue.Get(out temp);
3308                 pValue.Dispose();
3309                 return (BlendEquationType)temp;
3310             }
3311             set
3312             {
3313                 var temp = new Tizen.NUI.PropertyValue((int)value);
3314                 SetProperty(View.Property.BlendEquation, temp);
3315                 temp.Dispose();
3316                 NotifyPropertyChanged();
3317             }
3318         }
3319
3320         /// <summary>
3321         /// If the value is true, the View will change its style as the theme changes.
3322         /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3323         /// </summary>
3324         /// <since_tizen> 9 </since_tizen>
3325         public bool ThemeChangeSensitive
3326         {
3327             get => (bool)GetValue(ThemeChangeSensitiveProperty);
3328             set => SetValue(ThemeChangeSensitiveProperty, value);
3329         }
3330
3331         /// <summary>
3332         /// Create Style, it is abstract function and must be override.
3333         /// </summary>
3334         [EditorBrowsable(EditorBrowsableState.Never)]
3335         protected virtual ViewStyle CreateViewStyle()
3336         {
3337             return new ViewStyle();
3338         }
3339
3340         /// <summary>
3341         /// Called after the View's ControlStates changed.
3342         /// </summary>
3343         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3344         [EditorBrowsable(EditorBrowsableState.Never)]
3345         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3346         {
3347         }
3348
3349         /// <summary>
3350         /// </summary>
3351         [EditorBrowsable(EditorBrowsableState.Never)]
3352         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3353         {
3354             isThemeChanged = true;
3355             if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3356             else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3357             isThemeChanged = false;
3358         }
3359
3360         /// <summary>
3361         /// Apply style instance to the view.
3362         /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3363         /// </summary>
3364         /// <since_tizen> 9 </since_tizen>
3365         public virtual void ApplyStyle(ViewStyle viewStyle)
3366         {
3367             if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3368
3369             if (themeData == null) themeData = new ThemeData();
3370
3371             themeData.viewStyle = viewStyle;
3372
3373             if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3374             {
3375                 // Nothing to apply
3376                 return;
3377             }
3378
3379             BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3380
3381             if (bindablePropertyOfView == null)
3382             {
3383                 return;
3384             }
3385
3386             var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3387             viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3388
3389             foreach (var sourceProperty in dirtyStyleProperties)
3390             {
3391                 var sourceValue = viewStyle.GetValue(sourceProperty);
3392
3393                 if (sourceValue == null)
3394                 {
3395                     continue;
3396                 }
3397
3398                 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3399
3400                 // Do not set value again when theme is changed and the value has been set already.
3401                 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3402                 {
3403                     continue;
3404                 }
3405
3406                 if (destinationProperty != null)
3407                 {
3408                     InternalSetValue(destinationProperty, sourceValue);
3409                 }
3410             }
3411         }
3412
3413         /// <summary>
3414         /// Get whether the View is culled or not.
3415         /// True means that the View is out of the view frustum.
3416         /// </summary>
3417         /// <remarks>
3418         /// Hidden-API (Inhouse-API).
3419         /// </remarks>
3420         [EditorBrowsable(EditorBrowsableState.Never)]
3421         public bool Culled
3422         {
3423             get
3424             {
3425                 bool temp = false;
3426                 var pValue = GetProperty(View.Property.Culled);
3427                 pValue.Get(out temp);
3428                 pValue.Dispose();
3429                 return temp;
3430             }
3431         }
3432
3433         /// <summary>
3434         /// Set or Get TransitionOptions for the page transition.
3435         /// This property is used to define how this view will be transitioned during Page switching.
3436         /// </summary>
3437         /// <since_tizen> 9 </since_tizen>
3438         public TransitionOptions TransitionOptions
3439         {
3440             get
3441             {
3442                 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3443             }
3444             set
3445             {
3446                 SetValue(TransitionOptionsProperty, value);
3447                 NotifyPropertyChanged();
3448             }
3449         }
3450
3451         private TransitionOptions InternalTransitionOptions
3452         {
3453             set
3454             {
3455                 transitionOptions = value;
3456             }
3457             get
3458             {
3459                 return transitionOptions;
3460             }
3461         }
3462
3463         /// <summary>
3464         /// Gets or sets the status of whether the view should emit key event signals.
3465         /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3466         /// </summary>
3467         [EditorBrowsable(EditorBrowsableState.Never)]
3468         public bool DispatchKeyEvents
3469         {
3470             get
3471             {
3472                 return (bool)GetValue(DispatchKeyEventsProperty);
3473             }
3474             set
3475             {
3476                 SetValue(DispatchKeyEventsProperty, value);
3477                 NotifyPropertyChanged();
3478             }
3479         }
3480
3481         /// <summary>
3482         /// Gets or sets the status of whether touch events can be dispatched.
3483         /// If a View's DispatchTouchEvents is set to false, then it's can not will receive touch and parents will not receive a touch event signal either.
3484         /// This works without adding a TouchEvent callback in the View.
3485         /// <note>
3486         /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit touch event.
3487         /// </note>
3488         /// </summary>
3489         [EditorBrowsable(EditorBrowsableState.Never)]
3490         public bool DispatchTouchEvents
3491         {
3492             get
3493             {
3494                 return dispatchTouchEvents;
3495             }
3496             set
3497             {
3498                 if (dispatchTouchEvents != value)
3499                 {
3500                     dispatchTouchEvents = value;
3501                     if (dispatchTouchEvents == false)
3502                     {
3503                         TouchEvent += OnDispatchTouchEvent;
3504                     }
3505                     else
3506                     {
3507                         TouchEvent -= OnDispatchTouchEvent;
3508                     }
3509                 }
3510             }
3511         }
3512
3513         private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3514         {
3515             return true;
3516         }
3517
3518         /// <summary>
3519         /// Gets or sets the status of whether the view should emit Gesture event signals.
3520         /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3521         /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3522         /// </summary>
3523         [EditorBrowsable(EditorBrowsableState.Never)]
3524         public bool DispatchGestureEvents
3525         {
3526             get
3527             {
3528                 return dispatchGestureEvents;
3529             }
3530             set
3531             {
3532                 if (dispatchGestureEvents != value)
3533                 {
3534                     dispatchGestureEvents = value;
3535                     ConfigGestureDetector(dispatchGestureEvents);
3536                 }
3537             }
3538         }
3539
3540         /// <summary>
3541         /// Gets or sets the status of whether the view should emit Gesture event signals.
3542         /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3543         /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3544         /// </summary>
3545         [EditorBrowsable(EditorBrowsableState.Never)]
3546         public bool DispatchParentGestureEvents
3547         {
3548             get
3549             {
3550                 return dispatchParentGestureEvents;
3551             }
3552             set
3553             {
3554                 if (dispatchParentGestureEvents != value)
3555                 {
3556                     dispatchParentGestureEvents = value;
3557                     ConfigGestureDetector(dispatchParentGestureEvents);
3558                 }
3559             }
3560         }
3561
3562         private void ConfigGestureDetector(bool dispatch)
3563         {
3564             if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3565             if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3566             if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3567             if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3568             if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3569
3570             if (dispatch == true)
3571             {
3572                 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3573                 if (configGestureCount == 0)
3574                 {
3575                     panGestureDetector.Detach(this);
3576                     longGestureDetector.Detach(this);
3577                     pinchGestureDetector.Detach(this);
3578                     tapGestureDetector.Detach(this);
3579                     rotationGestureDetector.Detach(this);
3580
3581                     panGestureDetector.Detected -= OnGestureDetected;
3582                     longGestureDetector.Detected -= OnGestureDetected;
3583                     pinchGestureDetector.Detected -= OnGestureDetected;
3584                     tapGestureDetector.Detected -= OnGestureDetected;
3585                     rotationGestureDetector.Detected -= OnGestureDetected;
3586
3587                     panGestureDetector = null;
3588                     longGestureDetector = null;
3589                     pinchGestureDetector = null;
3590                     tapGestureDetector = null;
3591                     rotationGestureDetector = null;
3592                 }
3593             }
3594             else
3595             {
3596                 if (configGestureCount == 0)
3597                 {
3598                     panGestureDetector.Attach(this);
3599                     longGestureDetector.Attach(this);
3600                     pinchGestureDetector.Attach(this);
3601                     tapGestureDetector.Attach(this);
3602                     rotationGestureDetector.Attach(this);
3603
3604                     panGestureDetector.Detected += OnGestureDetected;
3605                     longGestureDetector.Detected += OnGestureDetected;
3606                     pinchGestureDetector.Detected += OnGestureDetected;
3607                     tapGestureDetector.Detected += OnGestureDetected;
3608                     rotationGestureDetector.Detected += OnGestureDetected;
3609                 }
3610                 configGestureCount++;
3611             }
3612         }
3613
3614         private void OnGestureDetected(object source, EventArgs e)
3615         {
3616             // Does notting. This is to consume the gesture.
3617         }
3618
3619         /// <summary>
3620         /// Called when the view is hit through TouchEvent or GestureEvent.
3621         /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3622         /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3623         /// User can override whether hit or not in HitTest.
3624         /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3625         /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3626         /// </summary>
3627         // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3628         [EditorBrowsable(EditorBrowsableState.Never)]
3629         protected virtual bool HitTest(Touch touch)
3630         {
3631             return true;
3632         }
3633
3634         /// <summary>
3635         /// Retrieve the View's current Color.
3636         /// </summary>
3637         /// <remarks>
3638         /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3639         /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
3640         /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3641         /// and users can get the current actual values through them.
3642         /// </remarks>
3643         [EditorBrowsable(EditorBrowsableState.Never)]
3644         public Color CurrentColor => GetCurrentColor();
3645
3646         /// <summary>
3647         /// Retrieve the current scale factor applied to the View.
3648         /// </summary>
3649         /// <remarks>
3650         /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3651         /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
3652         /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3653         /// and users can get the current actual values through them.
3654         /// </remarks>
3655         [EditorBrowsable(EditorBrowsableState.Never)]
3656         public Vector3 CurrentScale => GetCurrentScale();
3657
3658     }
3659 }