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