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