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