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