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