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