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