[NUI] Add some comments for NUI Layout (#2804)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
1 /*
2  * Copyright(c) 2021 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 using Tizen.NUI.Components;
23
24 namespace Tizen.NUI.BaseComponents
25 {
26     /// <summary>
27     /// View is the base class for all views.
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public partial class View : Container, IResourcesProvider
31     {
32         internal BackgroundExtraData backgroundExtraData;
33
34         private bool layoutSet = false;
35         private LayoutItem layout; // Exclusive layout assigned to this View.
36
37         // List of transitions paired with the condition that uses the transition.
38         private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
39         private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
40         private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
41         private float weight = 0.0f; // Weighting of child View in a Layout
42         private bool backgroundImageSynchronosLoading = false;
43         private bool controlStatePropagation = false;
44         private ViewStyle viewStyle;
45         private bool themeChangeSensitive = false;
46         private bool excludeLayouting = false;
47         private LayoutTransition layoutTransition;
48         private ControlState controlStates = ControlState.Normal;
49
50         static View() { }
51
52         /// <summary>
53         /// Creates a new instance of a view.
54         /// </summary>
55         /// <since_tizen> 3 </since_tizen>
56         public View() : this(Interop.View.New(), true)
57         {
58             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59         }
60
61         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
62         [EditorBrowsable(EditorBrowsableState.Never)]
63         public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
64         {
65         }
66
67         /// <summary>
68         /// Create a new instance of a View with setting the status of shown or hidden.
69         /// </summary>
70         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
71         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
72         [EditorBrowsable(EditorBrowsableState.Never)]
73         public View(bool shown) : this(Interop.View.New(), true)
74         {
75             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76             SetVisible(shown);
77         }
78
79         internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
80         {
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82             if (!shown)
83             {
84                 SetVisible(false);
85             }
86
87             backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
88         }
89
90         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
91         {
92             InitializeStyle(viewStyle);
93         }
94
95         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
96         {
97             if (HasBody())
98             {
99                 PositionUsesPivotPoint = false;
100             }
101
102             onWindowSendEventCallback = SendViewAddedEventToWindow;
103             this.OnWindowSignal().Connect(onWindowSendEventCallback);
104
105             if (!shown)
106             {
107                 SetVisible(false);
108             }
109         }
110
111         internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
112         {
113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114
115             if (!shown)
116             {
117                 SetVisible(false);
118             }
119         }
120
121         /// <summary>
122         /// The event that is triggered when the View's ControlState is changed.
123         /// </summary>
124         [EditorBrowsable(EditorBrowsableState.Never)]
125         public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
126
127         internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
128
129
130         /// <summary>
131         /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
132         /// </summary>
133         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
134         [EditorBrowsable(EditorBrowsableState.Never)]
135         public bool LayoutSet
136         {
137             get
138             {
139                 return layoutSet;
140             }
141         }
142
143         /// <summary>
144         /// Flag to allow Layouting to be disabled for Views.
145         /// Once a View has a Layout set then any children added to Views from then on will receive
146         /// automatic Layouts.
147         /// </summary>
148         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
149         [EditorBrowsable(EditorBrowsableState.Never)]
150         public static bool LayoutingDisabled { get; set; } = true;
151
152         /// <summary>
153         /// The style instance applied to this view.
154         /// Note that please do not modify the ViewStyle.
155         /// Modifying ViewStyle will affect other views with same ViewStyle.
156         /// </summary>
157         [EditorBrowsable(EditorBrowsableState.Never)]
158         protected ViewStyle ViewStyle
159         {
160             get
161             {
162                 if (null == viewStyle)
163                 {
164                     ApplyStyle(CreateViewStyle());
165                 }
166
167                 return viewStyle;
168             }
169         }
170
171         /// <summary>
172         /// Get/Set the control state.
173         /// Note that the ControlState only available for the classes derived from Control.
174         /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
175         /// please set <see cref="EnableControlState"/> to true.
176         /// </summary>
177         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
178         [EditorBrowsable(EditorBrowsableState.Never)]
179         public ControlState ControlState
180         {
181             get
182             {
183                 return controlStates;
184             }
185             protected set
186             {
187                 if (controlStates == value)
188                 {
189                     return;
190                 }
191
192                 var prevState = controlStates;
193
194                 controlStates = value;
195
196                 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
197
198                 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
199
200                 if (controlStatePropagation)
201                 {
202                     foreach (View child in Children)
203                     {
204                         child.ControlState = value;
205                     }
206                 }
207
208                 OnControlStateChanged(changeInfo);
209
210                 ControlStateChangedEvent?.Invoke(this, changeInfo);
211             }
212         }
213
214         /// <summary>
215         /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
216         /// </summary>
217         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
218         [EditorBrowsable(EditorBrowsableState.Never)]
219         public bool ExcludeLayouting
220         {
221             get
222             {
223                 return excludeLayouting;
224             }
225             set
226             {
227                 excludeLayouting = value;
228                 if (Layout != null && Layout.SetPositionByLayout == value)
229                 {
230                     Layout.SetPositionByLayout = !value;
231                     Layout.RequestLayout();
232                 }
233             }
234         }
235
236         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
237         [EditorBrowsable(EditorBrowsableState.Never)]
238         public bool IsResourcesCreated
239         {
240             get
241             {
242                 return Application.Current.IsResourcesCreated;
243             }
244         }
245
246         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
247         [EditorBrowsable(EditorBrowsableState.Never)]
248         public ResourceDictionary XamlResources
249         {
250             get
251             {
252                 return Application.Current.XamlResources;
253             }
254             set
255             {
256                 Application.Current.XamlResources = value;
257             }
258         }
259
260         /// <summary>
261         /// The StyleName, type string.
262         /// The value indicates DALi style name defined in json theme file.
263         /// </summary>
264         /// <since_tizen> 3 </since_tizen>
265         public string StyleName
266         {
267             get
268             {
269                 return (string)GetValue(StyleNameProperty);
270             }
271             set
272             {
273                 SetValue(StyleNameProperty, value);
274                 NotifyPropertyChanged();
275             }
276         }
277
278         /// <summary>
279         /// The KeyInputFocus, type bool.
280         /// </summary>
281         [EditorBrowsable(EditorBrowsableState.Never)]
282         public bool KeyInputFocus
283         {
284             get
285             {
286                 return (bool)GetValue(KeyInputFocusProperty);
287             }
288             set
289             {
290                 SetValue(KeyInputFocusProperty, value);
291                 NotifyPropertyChanged();
292             }
293         }
294
295         /// <summary>
296         /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
297         /// </summary>
298         /// <remarks>
299         /// <para>
300         /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
301         /// </para>
302         /// <para>
303         /// Animatable - This property can be animated using <c>Animation</c> class.
304         /// <code>
305         /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
306         /// </code>
307         /// </para>
308         /// </remarks>
309         /// <since_tizen> 3 </since_tizen>
310         public Color BackgroundColor
311         {
312             get
313             {
314                 Color temp = (Color)GetValue(BackgroundColorProperty);
315                 return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
316             }
317             set
318             {
319                 SetValue(BackgroundColorProperty, value);
320                 if (selectorData != null)
321                 {
322                     selectorData.BackgroundImage?.Reset(this);
323                     selectorData.BackgroundColor?.Reset(this);
324                 }
325                 NotifyPropertyChanged();
326             }
327         }
328
329         /// <summary>
330         /// The mutually exclusive with "backgroundColor" and "background" type Map.
331         /// </summary>
332         /// <since_tizen> 3 </since_tizen>
333         public string BackgroundImage
334         {
335             get
336             {
337                 return (string)GetValue(BackgroundImageProperty);
338             }
339             set
340             {
341                 SetValue(BackgroundImageProperty, value);
342                 if (selectorData != null)
343                 {
344                     selectorData.BackgroundColor?.Reset(this);
345                     selectorData.BackgroundImage?.Reset(this);
346                 }
347                 NotifyPropertyChanged();
348             }
349         }
350
351         /// <summary>
352         /// Get or set the border of background image.
353         /// </summary>
354         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
355         [EditorBrowsable(EditorBrowsableState.Never)]
356         public Rectangle BackgroundImageBorder
357         {
358             get
359             {
360                 return (Rectangle)GetValue(BackgroundImageBorderProperty);
361             }
362             set
363             {
364                 SetValue(BackgroundImageBorderProperty, value);
365                 selectorData?.BackgroundImageBorder?.Reset(this);
366                 NotifyPropertyChanged();
367             }
368         }
369
370         /// <summary>
371         /// The background of view.
372         /// </summary>
373         /// <since_tizen> 3 </since_tizen>
374         public Tizen.NUI.PropertyMap Background
375         {
376             get
377             {
378                 return (PropertyMap)GetValue(BackgroundProperty);
379             }
380             set
381             {
382                 SetValue(BackgroundProperty, value);
383                 NotifyPropertyChanged();
384             }
385         }
386
387         /// <summary>
388         /// Describes a shadow as an image for a View.
389         /// It is null by default.
390         /// </summary>
391         /// <remarks>
392         /// Getter returns copied instance of current shadow.
393         /// </remarks>
394         /// <remarks>
395         /// The mutually exclusive with "BoxShadow".
396         /// </remarks>
397         /// <remarks>
398         /// <para>
399         /// Animatable - This property can be animated using <c>Animation</c> class.
400         /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
401         /// <code>
402         /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
403         /// </code>
404         /// Animatable sub-property : Offset.
405         /// </para>
406         /// </remarks>
407         [EditorBrowsable(EditorBrowsableState.Never)]
408         public ImageShadow ImageShadow
409         {
410             get
411             {
412                 return (ImageShadow)GetValue(ImageShadowProperty);
413             }
414             set
415             {
416                 SetValue(ImageShadowProperty, value);
417                 if (selectorData != null)
418                 {
419                     selectorData.BoxShadow?.Reset(this);
420                     selectorData.ImageShadow?.Reset(this);
421                 }
422                 NotifyPropertyChanged();
423             }
424         }
425
426         /// <summary>
427         /// Describes a box shaped shadow drawing for a View.
428         /// It is null by default.
429         /// </summary>
430         /// <remarks>
431         /// Getter returns copied instance of current shadow.
432         /// </remarks>
433         /// <remarks>
434         /// The mutually exclusive with "ImageShadow".
435         /// </remarks>
436         /// <remarks>
437         /// <para>
438         /// Animatable - This property can be animated using <c>Animation</c> class.
439         /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
440         /// <code>
441         /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
442         /// </code>
443         /// Animatable sub-property : Offset, Color, BlurRadius.
444         /// </para>
445         /// </remarks>
446         [EditorBrowsable(EditorBrowsableState.Never)]
447         public Shadow BoxShadow
448         {
449             get
450             {
451                 return (Shadow)GetValue(BoxShadowProperty);
452             }
453             set
454             {
455                 SetValue(BoxShadowProperty, value);
456                 if (selectorData != null)
457                 {
458                     selectorData.ImageShadow?.Reset(this);
459                     selectorData.BoxShadow?.Reset(this);
460                 }
461                 NotifyPropertyChanged();
462             }
463         }
464
465         /// <summary>
466         /// The radius for the rounded corners of the View.
467         /// This will rounds background and shadow edges.
468         /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
469         /// </summary>
470         /// <remarks>
471         /// <para>
472         /// Animatable - This property can be animated using <c>Animation</c> class.
473         /// </para>
474         /// </remarks>
475         [EditorBrowsable(EditorBrowsableState.Never)]
476         public float CornerRadius
477         {
478             get
479             {
480                 return (float)GetValue(CornerRadiusProperty);
481             }
482             set
483             {
484                 SetValue(CornerRadiusProperty, value);
485                 NotifyPropertyChanged();
486             }
487         }
488
489         //
490         // Accessibility
491         //
492
493         [EditorBrowsable(EditorBrowsableState.Never)]
494         protected bool IsHighlighted
495         {
496             get
497             {
498                 return Accessibility.AccessibilityManager.Instance.GetCurrentFocusView() == this;
499             }
500         }
501
502         [EditorBrowsable(EditorBrowsableState.Never)]
503         protected static readonly string AccessibilityActivateAction = "activate";
504         [EditorBrowsable(EditorBrowsableState.Never)]
505         protected static readonly string AccessibilityReadingSkippedAction = "ReadingSkipped";
506         [EditorBrowsable(EditorBrowsableState.Never)]
507         protected static readonly string AccessibilityReadingCancelledAction = "ReadingCancelled";
508         [EditorBrowsable(EditorBrowsableState.Never)]
509         protected static readonly string AccessibilityReadingStoppedAction = "ReadingStopped";
510         [EditorBrowsable(EditorBrowsableState.Never)]
511         protected static readonly string AccessibilityReadingPausedAction = "ReadingPaused";
512         [EditorBrowsable(EditorBrowsableState.Never)]
513         protected static readonly string AccessibilityReadingResumedAction = "ReadingResumed";
514
515         [EditorBrowsable(EditorBrowsableState.Never)]
516         private static readonly string[] AccessibilityActions = {
517             AccessibilityActivateAction,
518             AccessibilityReadingSkippedAction,
519             AccessibilityReadingCancelledAction,
520             AccessibilityReadingStoppedAction,
521             AccessibilityReadingPausedAction,
522             AccessibilityReadingResumedAction,
523         };
524
525         [EditorBrowsable(EditorBrowsableState.Never)]
526         protected virtual string AccessibilityGetName()
527         {
528             return "";
529         }
530
531         [EditorBrowsable(EditorBrowsableState.Never)]
532         protected virtual string AccessibilityGetDescription()
533         {
534             return "";
535         }
536
537         [EditorBrowsable(EditorBrowsableState.Never)]
538         protected virtual bool AccessibilityDoAction(string name)
539         {
540             return false;
541         }
542
543         [EditorBrowsable(EditorBrowsableState.Never)]
544         protected virtual AccessibilityStates AccessibilityCalculateStates()
545         {
546             var states = new AccessibilityStates();
547             states.Set(AccessibilityState.Highlightable, this.AccessibilityHighlightable);
548             states.Set(AccessibilityState.Focusable, this.Focusable);
549             states.Set(AccessibilityState.Focused, this.State == States.Focused);
550             states.Set(AccessibilityState.Highlighted, this.IsHighlighted);
551             states.Set(AccessibilityState.Enabled, this.State != States.Disabled);
552             states.Set(AccessibilityState.Sensitive, this.Sensitive);
553             states.Set(AccessibilityState.Animated, this.AccessibilityAnimated);
554             states.Set(AccessibilityState.Visible, true);
555             states.Set(AccessibilityState.Showing, this.Visibility);
556             states.Set(AccessibilityState.Defunct, !this.IsOnWindow);
557             return states;
558         }
559
560         [EditorBrowsable(EditorBrowsableState.Never)]
561         protected virtual int AccessibilityGetActionCount()
562         {
563             return AccessibilityActions.Length;
564         }
565
566         [EditorBrowsable(EditorBrowsableState.Never)]
567         protected virtual string AccessibilityGetActionName(int index)
568         {
569             if (index >= 0 && index < AccessibilityActions.Length)
570                 return AccessibilityActions[index];
571             else
572                 return "";
573         }
574
575         [EditorBrowsable(EditorBrowsableState.Never)]
576         protected virtual bool AccessibilityShouldReportZeroChildren()
577         {
578             return false;
579         }
580
581         [EditorBrowsable(EditorBrowsableState.Never)]
582         protected virtual double AccessibilityGetMinimum()
583         {
584             return 0.0;
585         }
586
587         [EditorBrowsable(EditorBrowsableState.Never)]
588         protected virtual double AccessibilityGetCurrent()
589         {
590             return 0.0;
591         }
592
593         [EditorBrowsable(EditorBrowsableState.Never)]
594         protected virtual double AccessibilityGetMaximum()
595         {
596             return 0.0;
597         }
598
599         [EditorBrowsable(EditorBrowsableState.Never)]
600         protected virtual bool AccessibilitySetCurrent(double value)
601         {
602             return false;
603         }
604
605         [EditorBrowsable(EditorBrowsableState.Never)]
606         protected virtual double AccessibilityGetMinimumIncrement()
607         {
608             return 0.0;
609         }
610
611         [EditorBrowsable(EditorBrowsableState.Never)]
612         protected virtual bool AccessibilityIsScrollable()
613         {
614             return false;
615         }
616
617         [EditorBrowsable(EditorBrowsableState.Never)]
618         protected virtual string AccessibilityGetText(int startOffset, int endOffset)
619         {
620             return "";
621         }
622
623         [EditorBrowsable(EditorBrowsableState.Never)]
624         protected virtual int AccessibilityGetCharacterCount()
625         {
626             return 0;
627         }
628
629         [EditorBrowsable(EditorBrowsableState.Never)]
630         protected virtual int AccessibilityGetCaretOffset()
631         {
632             return 0;
633         }
634
635         [EditorBrowsable(EditorBrowsableState.Never)]
636         protected virtual bool AccessibilitySetCaretOffset(int offset)
637         {
638             return false;
639         }
640
641         [EditorBrowsable(EditorBrowsableState.Never)]
642         protected virtual AccessibilityRange AccessibilityGetTextAtOffset(int offset, TextBoundary boundary)
643         {
644             return new AccessibilityRange();
645         }
646
647         [EditorBrowsable(EditorBrowsableState.Never)]
648         protected virtual AccessibilityRange AccessibilityGetSelection(int selectionNum)
649         {
650             return new AccessibilityRange();
651         }
652
653         [EditorBrowsable(EditorBrowsableState.Never)]
654         protected virtual bool AccessibilityRemoveSelection(int selectionNum)
655         {
656             return false;
657         }
658
659         [EditorBrowsable(EditorBrowsableState.Never)]
660         protected virtual bool AccessibilitySetSelection(int selectionNum, int startOffset, int endOffset)
661         {
662             return false;
663         }
664
665         [EditorBrowsable(EditorBrowsableState.Never)]
666         protected virtual bool AccessibilityCopyText(int startPosition, int endPosition)
667         {
668             return false;
669         }
670
671         [EditorBrowsable(EditorBrowsableState.Never)]
672         protected virtual bool AccessibilityCutText(int startPosition, int endPosition)
673         {
674             return false;
675         }
676
677         /// <summary>
678         /// Whether the CornerRadius property value is relative (percentage [0.0f to 1.0f] of the view size) or absolute (in world units).
679         /// It is absolute by default.
680         /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
681         /// </summary>
682         [EditorBrowsable(EditorBrowsableState.Never)]
683         public VisualTransformPolicyType CornerRadiusPolicy
684         {
685             get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
686             set => SetValue(CornerRadiusPolicyProperty, value);
687         }
688
689         /// <summary>
690         /// The current state of the view.
691         /// </summary>
692         /// <since_tizen> 3 </since_tizen>
693         public States State
694         {
695             get
696             {
697                 return (States)GetValue(StateProperty);
698             }
699             set
700             {
701                 SetValue(StateProperty, value);
702                 NotifyPropertyChanged();
703             }
704         }
705
706         /// <summary>
707         /// The current sub state of the view.
708         /// </summary>
709         /// <since_tizen> 3 </since_tizen>
710         public States SubState
711         {
712             get
713             {
714                 return (States)GetValue(SubStateProperty);
715             }
716             set
717             {
718                 SetValue(SubStateProperty, value);
719                 NotifyPropertyChanged();
720             }
721         }
722
723         /// <summary>
724         /// Displays a tooltip
725         /// </summary>
726         /// <since_tizen> 3 </since_tizen>
727         public Tizen.NUI.PropertyMap Tooltip
728         {
729             get
730             {
731                 return (PropertyMap)GetValue(TooltipProperty);
732             }
733             set
734             {
735                 SetValue(TooltipProperty, value);
736                 NotifyPropertyChanged();
737             }
738         }
739
740         /// <summary>
741         /// Displays a tooltip as a text.
742         /// </summary>
743         /// <since_tizen> 3 </since_tizen>
744         public string TooltipText
745         {
746             get
747             {
748                 using (var propertyValue = GetProperty(Property.TOOLTIP))
749                 {
750                     if (propertyValue != null && propertyValue.Get(out string retrivedValue))
751                     {
752                         return retrivedValue;
753                     }
754                     NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
755                     return "error to get TooltipText";
756                 }
757             }
758             set
759             {
760                 var temp = new Tizen.NUI.PropertyValue(value);
761                 SetProperty(View.Property.TOOLTIP, temp);
762                 temp.Dispose();
763                 NotifyPropertyChanged();
764             }
765         }
766
767         /// <summary>
768         /// The Child property of FlexContainer.<br />
769         /// The proportion of the free space in the container, the flex item will receive.<br />
770         /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
771         /// </summary>
772         /// <since_tizen> 3 </since_tizen>
773         [Obsolete("Deprecated in API8, will be removed in API10.")]
774         public float Flex
775         {
776             get
777             {
778                 return (float)GetValue(FlexProperty);
779             }
780             set
781             {
782                 SetValue(FlexProperty, value);
783                 NotifyPropertyChanged();
784             }
785         }
786
787         /// <summary>
788         /// The Child property of FlexContainer.<br />
789         /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
790         /// </summary>
791         /// <since_tizen> 3 </since_tizen>
792         [Obsolete("Deprecated in API8, will be removed in API10.")]
793         public int AlignSelf
794         {
795             get
796             {
797                 return (int)GetValue(AlignSelfProperty);
798             }
799             set
800             {
801                 SetValue(AlignSelfProperty, value);
802                 NotifyPropertyChanged();
803             }
804         }
805
806         /// <summary>
807         /// The Child property of FlexContainer.<br />
808         /// The space around the flex item.<br />
809         /// </summary>
810         /// <remarks>
811         /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
812         /// </remarks>
813         /// <since_tizen> 3 </since_tizen>
814         [Obsolete("Deprecated in API8, will be removed in API10.")]
815         public Vector4 FlexMargin
816         {
817             get
818             {
819                 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
820                 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
821             }
822             set
823             {
824                 SetValue(FlexMarginProperty, value);
825                 NotifyPropertyChanged();
826             }
827         }
828
829         /// <summary>
830         /// The top-left cell this child occupies, if not set, the first available cell is used.
831         /// </summary>
832         /// <remarks>
833         /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
834         /// </remarks>
835         /// <since_tizen> 3 </since_tizen>
836         public Vector2 CellIndex
837         {
838             get
839             {
840                 Vector2 temp = (Vector2)GetValue(CellIndexProperty);
841                 return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
842             }
843             set
844             {
845                 SetValue(CellIndexProperty, value);
846                 NotifyPropertyChanged();
847             }
848         }
849
850         /// <summary>
851         /// The number of rows this child occupies, if not set, the default value is 1.
852         /// </summary>
853         /// <since_tizen> 3 </since_tizen>
854         public float RowSpan
855         {
856             get
857             {
858                 return (float)GetValue(RowSpanProperty);
859             }
860             set
861             {
862                 SetValue(RowSpanProperty, value);
863                 NotifyPropertyChanged();
864             }
865         }
866
867         /// <summary>
868         /// The number of columns this child occupies, if not set, the default value is 1.
869         /// </summary>
870         /// <since_tizen> 3 </since_tizen>
871         public float ColumnSpan
872         {
873             get
874             {
875                 return (float)GetValue(ColumnSpanProperty);
876             }
877             set
878             {
879                 SetValue(ColumnSpanProperty, value);
880                 NotifyPropertyChanged();
881             }
882         }
883
884         /// <summary>
885         /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
886         /// </summary>
887         /// <since_tizen> 3 </since_tizen>
888         public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
889         {
890             get
891             {
892                 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
893             }
894             set
895             {
896                 SetValue(CellHorizontalAlignmentProperty, value);
897                 NotifyPropertyChanged();
898             }
899         }
900
901         /// <summary>
902         /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
903         /// </summary>
904         /// <since_tizen> 3 </since_tizen>
905         public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
906         {
907             get
908             {
909                 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
910             }
911             set
912             {
913                 SetValue(CellVerticalAlignmentProperty, value);
914                 NotifyPropertyChanged();
915             }
916         }
917
918         /// <summary>
919         /// The left focusable view.<br />
920         /// This will return null if not set.<br />
921         /// This will also return null if the specified left focusable view is not on a window.<br />
922         /// </summary>
923         /// <since_tizen> 3 </since_tizen>
924         public View LeftFocusableView
925         {
926             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
927             get
928             {
929                 return (View)GetValue(LeftFocusableViewProperty);
930             }
931             set
932             {
933                 SetValue(LeftFocusableViewProperty, value);
934                 NotifyPropertyChanged();
935             }
936         }
937
938         /// <summary>
939         /// The right focusable view.<br />
940         /// This will return null if not set.<br />
941         /// This will also return null if the specified right focusable view is not on a window.<br />
942         /// </summary>
943         /// <since_tizen> 3 </since_tizen>
944         public View RightFocusableView
945         {
946             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
947             get
948             {
949                 return (View)GetValue(RightFocusableViewProperty);
950             }
951             set
952             {
953                 SetValue(RightFocusableViewProperty, value);
954                 NotifyPropertyChanged();
955             }
956         }
957
958         /// <summary>
959         /// The up focusable view.<br />
960         /// This will return null if not set.<br />
961         /// This will also return null if the specified up focusable view is not on a window.<br />
962         /// </summary>
963         /// <since_tizen> 3 </since_tizen>
964         public View UpFocusableView
965         {
966             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
967             get
968             {
969                 return (View)GetValue(UpFocusableViewProperty);
970             }
971             set
972             {
973                 SetValue(UpFocusableViewProperty, value);
974                 NotifyPropertyChanged();
975             }
976         }
977
978         /// <summary>
979         /// The down focusable view.<br />
980         /// This will return null if not set.<br />
981         /// This will also return null if the specified down focusable view is not on a window.<br />
982         /// </summary>
983         /// <since_tizen> 3 </since_tizen>
984         public View DownFocusableView
985         {
986             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
987             get
988             {
989                 return (View)GetValue(DownFocusableViewProperty);
990             }
991             set
992             {
993                 SetValue(DownFocusableViewProperty, value);
994                 NotifyPropertyChanged();
995             }
996         }
997
998         /// <summary>
999         /// Whether the view should be focusable by keyboard navigation.
1000         /// </summary>
1001         /// <since_tizen> 3 </since_tizen>
1002         public bool Focusable
1003         {
1004             set
1005             {
1006                 SetValue(FocusableProperty, value);
1007                 NotifyPropertyChanged();
1008             }
1009             get
1010             {
1011                 return (bool)GetValue(FocusableProperty);
1012             }
1013         }
1014
1015         /// <summary>
1016         ///  Retrieves the position of the view.<br />
1017         ///  The coordinates are relative to the view's parent.<br />
1018         /// </summary>
1019         /// <since_tizen> 3 </since_tizen>
1020         public Position CurrentPosition
1021         {
1022             get
1023             {
1024                 return GetCurrentPosition();
1025             }
1026         }
1027
1028         /// <summary>
1029         /// Sets the size of a view for the width and the height.<br />
1030         /// Geometry can be scaled to fit within this area.<br />
1031         /// This does not interfere with the view's scale factor.<br />
1032         /// The views default depth is the minimum of width and height.<br />
1033         /// </summary>
1034         /// <remarks>
1035         /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
1036         /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
1037         /// </remarks>
1038         /// <since_tizen> 3 </since_tizen>
1039         public Size2D Size2D
1040         {
1041             get
1042             {
1043                 Size2D temp = (Size2D)GetValue(Size2DProperty);
1044                 int width = temp.Width;
1045                 int height = temp.Height;
1046
1047                 if (this.Layout == null)
1048                 {
1049                     if (width < 0) { width = 0; }
1050                     if (height < 0) { height = 0; }
1051                 }
1052
1053                 return new Size2D(OnSize2DChanged, width, height);
1054             }
1055             set
1056             {
1057                 SetValue(Size2DProperty, value);
1058
1059                 NotifyPropertyChanged();
1060             }
1061         }
1062
1063         /// <summary>
1064         ///  Retrieves the size of the view.<br />
1065         ///  The coordinates are relative to the view's parent.<br />
1066         /// </summary>
1067         /// <since_tizen> 3 </since_tizen>
1068         public Size2D CurrentSize
1069         {
1070             get
1071             {
1072                 return GetCurrentSize();
1073             }
1074         }
1075
1076         /// <summary>
1077         /// Retrieves and sets the view's opacity.<br />
1078         /// </summary>
1079         /// <since_tizen> 3 </since_tizen>
1080         public float Opacity
1081         {
1082             get
1083             {
1084                 return (float)GetValue(OpacityProperty);
1085             }
1086             set
1087             {
1088                 SetValue(OpacityProperty, value);
1089                 selectorData?.Opacity?.Reset(this);
1090                 NotifyPropertyChanged();
1091             }
1092         }
1093
1094         /// <summary>
1095         /// Sets the position of the view for X and Y.<br />
1096         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1097         /// If the position inheritance is disabled, sets the world position.<br />
1098         /// </summary>
1099         /// <remarks>
1100         /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
1101         /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
1102         /// </remarks>
1103         /// <since_tizen> 3 </since_tizen>
1104         public Position2D Position2D
1105         {
1106             get
1107             {
1108                 Position2D temp = (Position2D)GetValue(Position2DProperty);
1109                 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
1110             }
1111             set
1112             {
1113                 SetValue(Position2DProperty, value);
1114                 NotifyPropertyChanged();
1115             }
1116         }
1117
1118         /// <summary>
1119         /// Retrieves the screen position of the view.<br />
1120         /// </summary>
1121         /// <since_tizen> 3 </since_tizen>
1122         public Vector2 ScreenPosition
1123         {
1124             get
1125             {
1126                 Vector2 temp = new Vector2(0.0f, 0.0f);
1127                 var pValue = GetProperty(View.Property.ScreenPosition);
1128                 pValue.Get(temp);
1129                 pValue.Dispose();
1130                 return temp;
1131             }
1132         }
1133
1134         /// <summary>
1135         /// Determines whether the pivot point should be used to determine the position of the view.
1136         /// This is false by default.
1137         /// </summary>
1138         /// <remarks>If false, then the top-left of the view is used for the position.
1139         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1140         /// </remarks>
1141         /// <since_tizen> 3 </since_tizen>
1142         public bool PositionUsesPivotPoint
1143         {
1144             get
1145             {
1146                 return (bool)GetValue(PositionUsesPivotPointProperty);
1147             }
1148             set
1149             {
1150                 SetValue(PositionUsesPivotPointProperty, value);
1151                 NotifyPropertyChanged();
1152             }
1153         }
1154
1155         /// <summary>
1156         /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
1157         /// </summary>
1158         /// <since_tizen> 3 </since_tizen>
1159         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
1160             "Like: " +
1161             "View view = new View(); " +
1162             "view.PivotPoint = PivotPoint.Center; " +
1163             "view.PositionUsesPivotPoint = true;" +
1164             " Deprecated in API5: Will be removed in API8")]
1165         [EditorBrowsable(EditorBrowsableState.Never)]
1166         public bool PositionUsesAnchorPoint
1167         {
1168             get
1169             {
1170                 bool temp = false;
1171                 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1172                 pValue.Get(out temp);
1173                 pValue.Dispose();
1174                 return temp;
1175             }
1176             set
1177             {
1178                 var temp = new Tizen.NUI.PropertyValue(value);
1179                 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1180                 temp.Dispose();
1181                 NotifyPropertyChanged();
1182             }
1183         }
1184
1185         /// <summary>
1186         /// Queries whether the view is connected to the stage.<br />
1187         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1188         /// </summary>
1189         /// <since_tizen> 3 </since_tizen>
1190         public bool IsOnWindow
1191         {
1192             get
1193             {
1194                 return OnWindow();
1195             }
1196         }
1197
1198         /// <summary>
1199         /// Gets the depth in the hierarchy for the view.
1200         /// </summary>
1201         /// <since_tizen> 3 </since_tizen>
1202         public int HierarchyDepth
1203         {
1204             get
1205             {
1206                 return GetHierarchyDepth();
1207             }
1208         }
1209
1210         /// <summary>
1211         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1212         /// </summary>
1213         /// <remarks>
1214         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1215         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1216         /// The values set by this property will likely change.
1217         /// </remarks>
1218         /// <since_tizen> 3 </since_tizen>
1219         public int SiblingOrder
1220         {
1221             get
1222             {
1223                 return (int)GetValue(SiblingOrderProperty);
1224             }
1225             set
1226             {
1227                 SetValue(SiblingOrderProperty, value);
1228
1229                 LayoutGroup layout = Layout as LayoutGroup;
1230                 layout?.ChangeLayoutSiblingOrder(value);
1231
1232                 NotifyPropertyChanged();
1233             }
1234         }
1235
1236         /// <summary>
1237         /// Returns the natural size of the view.
1238         /// </summary>
1239         /// <remarks>
1240         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1241         /// </remarks>
1242         /// <since_tizen> 5 </since_tizen>
1243         public Vector3 NaturalSize
1244         {
1245             get
1246             {
1247                 Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1248                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1249                 return ret;
1250             }
1251         }
1252
1253         /// <summary>
1254         /// Returns the natural size (Size2D) of the view.
1255         /// </summary>
1256         /// <remarks>
1257         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1258         /// </remarks>
1259         /// <since_tizen> 4 </since_tizen>
1260         public Size2D NaturalSize2D
1261         {
1262             get
1263             {
1264                 Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1265                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1266
1267                 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1268                 temp.Dispose();
1269                 return sz;
1270             }
1271         }
1272
1273         /// <summary>
1274         /// Gets or sets the origin of a view within its parent's area.<br />
1275         /// 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 />
1276         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1277         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1278         /// </summary>
1279         /// <pre>The view has been initialized.</pre>
1280         /// <since_tizen> 3 </since_tizen>
1281         public Position ParentOrigin
1282         {
1283             get
1284             {
1285                 Position tmp = (Position)GetValue(ParentOriginProperty);
1286                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1287             }
1288             set
1289             {
1290                 SetValue(ParentOriginProperty, value);
1291                 NotifyPropertyChanged();
1292             }
1293         }
1294
1295         /// <summary>
1296         /// Gets or sets the anchor-point of a view.<br />
1297         /// 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 />
1298         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1299         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1300         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1301         /// <pre>The view has been initialized.</pre>
1302         /// </summary>
1303         /// <remarks>
1304         /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
1305         /// </remarks>
1306         /// <since_tizen> 3 </since_tizen>
1307         public Position PivotPoint
1308         {
1309             get
1310             {
1311                 Position tmp = (Position)GetValue(PivotPointProperty);
1312                 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
1313             }
1314             set
1315             {
1316                 SetValue(PivotPointProperty, value);
1317                 NotifyPropertyChanged();
1318             }
1319         }
1320
1321         /// <summary>
1322         /// Gets or sets the size width of the view.
1323         /// </summary>
1324         /// <remarks>
1325         /// <para>
1326         /// Animatable - This property can be animated using <c>Animation</c> class.
1327         /// </para>
1328         /// </remarks>
1329         /// <since_tizen> 3 </since_tizen>
1330         public float SizeWidth
1331         {
1332             get
1333             {
1334                 return (float)GetValue(SizeWidthProperty);
1335             }
1336             set
1337             {
1338                 SetValue(SizeWidthProperty, value);
1339                 NotifyPropertyChanged();
1340             }
1341         }
1342
1343         /// <summary>
1344         /// Gets or sets the size height of the view.
1345         /// </summary>
1346         /// <remarks>
1347         /// <para>
1348         /// Animatable - This property can be animated using <c>Animation</c> class.
1349         /// </para>
1350         /// </remarks>
1351         /// <since_tizen> 3 </since_tizen>
1352         public float SizeHeight
1353         {
1354             get
1355             {
1356                 return (float)GetValue(SizeHeightProperty);
1357             }
1358             set
1359             {
1360                 SetValue(SizeHeightProperty, value);
1361                 NotifyPropertyChanged();
1362             }
1363         }
1364
1365         /// <summary>
1366         /// Gets or sets the position of the view.<br />
1367         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1368         /// If the position inheritance is disabled, sets the world position.<br />
1369         /// </summary>
1370         /// <remarks>
1371         /// <para>
1372         /// Animatable - This property can be animated using <c>Animation</c> class.
1373         /// </para>
1374         /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1375         /// </remarks>
1376         /// <since_tizen> 3 </since_tizen>
1377         public Position Position
1378         {
1379             get
1380             {
1381                 Position tmp = (Position)GetValue(PositionProperty);
1382                 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1383             }
1384             set
1385             {
1386                 SetValue(PositionProperty, value);
1387                 NotifyPropertyChanged();
1388             }
1389         }
1390
1391         /// <summary>
1392         /// Gets or sets the position X of the view.
1393         /// </summary>
1394         /// <remarks>
1395         /// <para>
1396         /// Animatable - This property can be animated using <c>Animation</c> class.
1397         /// </para>
1398         /// </remarks>
1399         /// <since_tizen> 3 </since_tizen>
1400         public float PositionX
1401         {
1402             get
1403             {
1404                 return (float)GetValue(PositionXProperty);
1405             }
1406             set
1407             {
1408                 SetValue(PositionXProperty, value);
1409                 NotifyPropertyChanged();
1410             }
1411         }
1412
1413         /// <summary>
1414         /// Gets or sets the position Y of the view.
1415         /// </summary>
1416         /// <remarks>
1417         /// <para>
1418         /// Animatable - This property can be animated using <c>Animation</c> class.
1419         /// </para>
1420         /// </remarks>
1421         /// <since_tizen> 3 </since_tizen>
1422         public float PositionY
1423         {
1424             get
1425             {
1426                 return (float)GetValue(PositionYProperty);
1427             }
1428             set
1429             {
1430                 SetValue(PositionYProperty, value);
1431                 NotifyPropertyChanged();
1432             }
1433         }
1434
1435         /// <summary>
1436         /// Gets or sets the position Z of the view.
1437         /// </summary>
1438         /// <remarks>
1439         /// <para>
1440         /// Animatable - This property can be animated using <c>Animation</c> class.
1441         /// </para>
1442         /// </remarks>
1443         /// <since_tizen> 3 </since_tizen>
1444         public float PositionZ
1445         {
1446             get
1447             {
1448                 return (float)GetValue(PositionZProperty);
1449             }
1450             set
1451             {
1452                 SetValue(PositionZProperty, value);
1453                 NotifyPropertyChanged();
1454             }
1455         }
1456
1457         /// <summary>
1458         /// Gets or sets the world position of the view.
1459         /// </summary>
1460         /// <since_tizen> 3 </since_tizen>
1461         public Vector3 WorldPosition
1462         {
1463             get
1464             {
1465                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1466                 var pValue = GetProperty(View.Property.WorldPosition);
1467                 pValue.Get(temp);
1468                 pValue.Dispose();
1469                 return temp;
1470             }
1471         }
1472
1473         /// <summary>
1474         /// Gets or sets the orientation of the view.<br />
1475         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1476         /// </summary>
1477         /// <remarks>
1478         /// <para>
1479         /// This is an asynchronous method.
1480         /// </para>
1481         /// <para>
1482         /// Animatable - This property can be animated using <c>Animation</c> class.
1483         /// </para>
1484         /// </remarks>
1485         /// <since_tizen> 3 </since_tizen>
1486         public Rotation Orientation
1487         {
1488             get
1489             {
1490                 return (Rotation)GetValue(OrientationProperty);
1491             }
1492             set
1493             {
1494                 SetValue(OrientationProperty, value);
1495                 NotifyPropertyChanged();
1496             }
1497         }
1498
1499         /// <summary>
1500         /// Gets or sets the world orientation of the view.<br />
1501         /// </summary>
1502         /// <since_tizen> 3 </since_tizen>
1503         public Rotation WorldOrientation
1504         {
1505             get
1506             {
1507                 Rotation temp = new Rotation();
1508                 var pValue = GetProperty(View.Property.WorldOrientation);
1509                 pValue.Get(temp);
1510                 pValue.Dispose();
1511                 return temp;
1512             }
1513         }
1514
1515         /// <summary>
1516         /// Gets or sets the scale factor applied to the view.<br />
1517         /// </summary>
1518         /// <remarks>
1519         /// <para>
1520         /// Animatable - This property can be animated using <c>Animation</c> class.
1521         /// </para>
1522         /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1523         /// </remarks>
1524         /// <since_tizen> 3 </since_tizen>
1525         public Vector3 Scale
1526         {
1527             get
1528             {
1529                 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1530                 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1531             }
1532             set
1533             {
1534                 SetValue(ScaleProperty, value);
1535                 NotifyPropertyChanged();
1536             }
1537         }
1538
1539         /// <summary>
1540         /// Gets or sets the scale X factor applied to the view.
1541         /// </summary>
1542         /// <remarks>
1543         /// <para>
1544         /// Animatable - This property can be animated using <c>Animation</c> class.
1545         /// </para>
1546         /// </remarks>
1547         /// <since_tizen> 3 </since_tizen>
1548         public float ScaleX
1549         {
1550             get
1551             {
1552                 return (float)GetValue(ScaleXProperty);
1553             }
1554             set
1555             {
1556                 SetValue(ScaleXProperty, value);
1557                 NotifyPropertyChanged();
1558             }
1559         }
1560
1561         /// <summary>
1562         /// Gets or sets the scale Y factor applied to the view.
1563         /// </summary>
1564         /// <remarks>
1565         /// <para>
1566         /// Animatable - This property can be animated using <c>Animation</c> class.
1567         /// </para>
1568         /// </remarks>
1569         /// <since_tizen> 3 </since_tizen>
1570         public float ScaleY
1571         {
1572             get
1573             {
1574                 return (float)GetValue(ScaleYProperty);
1575             }
1576             set
1577             {
1578                 SetValue(ScaleYProperty, value);
1579                 NotifyPropertyChanged();
1580             }
1581         }
1582
1583         /// <summary>
1584         /// Gets or sets the scale Z factor applied to the view.
1585         /// </summary>
1586         /// <remarks>
1587         /// <para>
1588         /// Animatable - This property can be animated using <c>Animation</c> class.
1589         /// </para>
1590         /// </remarks>
1591         /// <since_tizen> 3 </since_tizen>
1592         public float ScaleZ
1593         {
1594             get
1595             {
1596                 return (float)GetValue(ScaleZProperty);
1597             }
1598             set
1599             {
1600                 SetValue(ScaleZProperty, value);
1601                 NotifyPropertyChanged();
1602             }
1603         }
1604
1605         /// <summary>
1606         /// Gets the world scale of the view.
1607         /// </summary>
1608         /// <since_tizen> 3 </since_tizen>
1609         public Vector3 WorldScale
1610         {
1611             get
1612             {
1613                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1614                 var pValue = GetProperty(View.Property.WorldScale);
1615                 pValue.Get(temp);
1616                 pValue.Dispose();
1617                 return temp;
1618             }
1619         }
1620
1621         /// <summary>
1622         /// Retrieves the visibility flag of the view.
1623         /// </summary>
1624         /// <remarks>
1625         /// <para>
1626         /// If the view is not visible, then the view and its children will not be rendered.
1627         /// 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.
1628         /// </para>
1629         /// <para>
1630         /// Animatable - This property can be animated using <c>Animation</c> class.
1631         /// </para>
1632         /// </remarks>
1633         /// <since_tizen> 3 </since_tizen>
1634         public bool Visibility
1635         {
1636             get
1637             {
1638                 bool temp = false;
1639                 var pValue = GetProperty(View.Property.VISIBLE);
1640                 pValue.Get(out temp);
1641                 pValue.Dispose();
1642                 return temp;
1643             }
1644         }
1645
1646         /// <summary>
1647         /// Gets the view's world color.
1648         /// </summary>
1649         /// <since_tizen> 3 </since_tizen>
1650         public Vector4 WorldColor
1651         {
1652             get
1653             {
1654                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1655                 var pValue = GetProperty(View.Property.WorldColor);
1656                 pValue.Get(temp);
1657                 pValue.Dispose();
1658                 return temp;
1659             }
1660         }
1661
1662         /// <summary>
1663         /// Gets or sets the view's name.
1664         /// </summary>
1665         /// <since_tizen> 3 </since_tizen>
1666         public string Name
1667         {
1668             get
1669             {
1670                 return (string)GetValue(NameProperty);
1671             }
1672             set
1673             {
1674                 SetValue(NameProperty, value);
1675                 NotifyPropertyChanged();
1676             }
1677         }
1678
1679         /// <summary>
1680         /// Get the number of children held by the view.
1681         /// </summary>
1682         /// <since_tizen> 3 </since_tizen>
1683         public new uint ChildCount
1684         {
1685             get
1686             {
1687                 return Convert.ToUInt32(Children.Count);
1688             }
1689         }
1690
1691         /// <summary>
1692         /// Gets the view's ID.
1693         /// Read-only
1694         /// </summary>
1695         /// <since_tizen> 3 </since_tizen>
1696         public uint ID
1697         {
1698             get
1699             {
1700                 return GetId();
1701             }
1702         }
1703
1704         /// <summary>
1705         /// Gets or sets the status of whether the view should emit touch or hover signals.
1706         /// </summary>
1707         /// <since_tizen> 3 </since_tizen>
1708         public bool Sensitive
1709         {
1710             get
1711             {
1712                 return (bool)GetValue(SensitiveProperty);
1713             }
1714             set
1715             {
1716                 SetValue(SensitiveProperty, value);
1717                 NotifyPropertyChanged();
1718             }
1719         }
1720
1721         /// <summary>
1722         /// 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.
1723         /// </summary>
1724         /// <since_tizen> 3 </since_tizen>
1725         public bool LeaveRequired
1726         {
1727             get
1728             {
1729                 return (bool)GetValue(LeaveRequiredProperty);
1730             }
1731             set
1732             {
1733                 SetValue(LeaveRequiredProperty, value);
1734                 NotifyPropertyChanged();
1735             }
1736         }
1737
1738         /// <summary>
1739         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1740         /// </summary>
1741         /// <since_tizen> 3 </since_tizen>
1742         public bool InheritOrientation
1743         {
1744             get
1745             {
1746                 return (bool)GetValue(InheritOrientationProperty);
1747             }
1748             set
1749             {
1750                 SetValue(InheritOrientationProperty, value);
1751                 NotifyPropertyChanged();
1752             }
1753         }
1754
1755         /// <summary>
1756         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1757         /// </summary>
1758         /// <since_tizen> 3 </since_tizen>
1759         public bool InheritScale
1760         {
1761             get
1762             {
1763                 return (bool)GetValue(InheritScaleProperty);
1764             }
1765             set
1766             {
1767                 SetValue(InheritScaleProperty, value);
1768                 NotifyPropertyChanged();
1769             }
1770         }
1771
1772         /// <summary>
1773         /// Gets or sets the status of how the view and its children should be drawn.<br />
1774         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1775         /// 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 />
1776         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1777         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1778         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1779         /// </summary>
1780         /// <since_tizen> 3 </since_tizen>
1781         public DrawModeType DrawMode
1782         {
1783             get
1784             {
1785                 return (DrawModeType)GetValue(DrawModeProperty);
1786             }
1787             set
1788             {
1789                 SetValue(DrawModeProperty, value);
1790                 NotifyPropertyChanged();
1791             }
1792         }
1793
1794         /// <summary>
1795         /// Gets or sets the relative to parent size factor of the view.<br />
1796         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1797         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1798         /// </summary>
1799         /// <remarks>
1800         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1801         /// </remarks>
1802         /// <since_tizen> 3 </since_tizen>
1803         public Vector3 SizeModeFactor
1804         {
1805             get
1806             {
1807                 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1808                 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1809             }
1810             set
1811             {
1812                 SetValue(SizeModeFactorProperty, value);
1813                 NotifyPropertyChanged();
1814             }
1815         }
1816
1817         /// <summary>
1818         /// Gets or sets the width resize policy to be used.
1819         /// </summary>
1820         /// <since_tizen> 3 </since_tizen>
1821         public ResizePolicyType WidthResizePolicy
1822         {
1823             get
1824             {
1825                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1826             }
1827             set
1828             {
1829                 SetValue(WidthResizePolicyProperty, value);
1830                 NotifyPropertyChanged();
1831             }
1832         }
1833
1834         /// <summary>
1835         /// Gets or sets the height resize policy to be used.
1836         /// </summary>
1837         /// <since_tizen> 3 </since_tizen>
1838         public ResizePolicyType HeightResizePolicy
1839         {
1840             get
1841             {
1842                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1843             }
1844             set
1845             {
1846                 SetValue(HeightResizePolicyProperty, value);
1847                 NotifyPropertyChanged();
1848             }
1849         }
1850
1851         /// <summary>
1852         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1853         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1854         /// </summary>
1855         /// <since_tizen> 3 </since_tizen>
1856         public SizeScalePolicyType SizeScalePolicy
1857         {
1858             get
1859             {
1860                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1861             }
1862             set
1863             {
1864                 SetValue(SizeScalePolicyProperty, value);
1865                 NotifyPropertyChanged();
1866             }
1867         }
1868
1869         /// <summary>
1870         ///  Gets or sets the status of whether the width size is dependent on the height size.
1871         /// </summary>
1872         /// <since_tizen> 3 </since_tizen>
1873         public bool WidthForHeight
1874         {
1875             get
1876             {
1877                 return (bool)GetValue(WidthForHeightProperty);
1878             }
1879             set
1880             {
1881                 SetValue(WidthForHeightProperty, value);
1882                 NotifyPropertyChanged();
1883             }
1884         }
1885
1886         /// <summary>
1887         /// Gets or sets the status of whether the height size is dependent on the width size.
1888         /// </summary>
1889         /// <since_tizen> 3 </since_tizen>
1890         public bool HeightForWidth
1891         {
1892             get
1893             {
1894                 return (bool)GetValue(HeightForWidthProperty);
1895             }
1896             set
1897             {
1898                 SetValue(HeightForWidthProperty, value);
1899                 NotifyPropertyChanged();
1900             }
1901         }
1902
1903         /// <summary>
1904         /// Gets or sets the padding for use in layout.
1905         /// </summary>
1906         /// <remarks>
1907         /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1908         /// </remarks>
1909         /// <since_tizen> 5 </since_tizen>
1910         public Extents Padding
1911         {
1912             get
1913             {
1914                 // If View has a Layout then padding in stored in the base Layout class
1915                 if (Layout != null)
1916                 {
1917                     return Layout.Padding;
1918                 }
1919                 else
1920                 {
1921                     Extents temp = (Extents)GetValue(PaddingProperty);
1922                     return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1923                 }
1924                 // Two return points to prevent creating a zeroed Extent native object before assignment
1925             }
1926             set
1927             {
1928                 Extents padding = value;
1929                 if (Layout != null)
1930                 {
1931                     // Layout set so store Padding in LayoutItem instead of in View.
1932                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
1933                     // the position and sizes measure in the Layouting.
1934                     Layout.Padding = value;
1935                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1936                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
1937                     if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
1938                     {
1939                         padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
1940                     }
1941                 }
1942
1943                 SetValue(PaddingProperty, padding);
1944                 NotifyPropertyChanged();
1945             }
1946         }
1947
1948         /// <summary>
1949         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1950         /// </summary>
1951         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
1952         /// <remarks>
1953         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1954         /// </remarks>
1955         /// <since_tizen> 3 </since_tizen>
1956         public Size2D MinimumSize
1957         {
1958             get
1959             {
1960                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1961                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1962             }
1963             set
1964             {
1965                 if (value == null)
1966                 {
1967                     throw new ArgumentNullException(nameof(value));
1968                 }
1969                 if (layout != null)
1970                 {
1971                     // Note: it only works if minimum size is >= than natural size.
1972                     // To force the size it should be done through the width&height spec or Size2D.
1973                     layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1974                     layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1975                     layout.RequestLayout();
1976                 }
1977                 SetValue(MinimumSizeProperty, value);
1978                 NotifyPropertyChanged();
1979             }
1980         }
1981
1982         /// <summary>
1983         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1984         /// </summary>
1985         /// <remarks>
1986         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1987         /// </remarks>
1988         /// <since_tizen> 3 </since_tizen>
1989         public Size2D MaximumSize
1990         {
1991             get
1992             {
1993                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1994                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1995             }
1996             set
1997             {
1998                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1999                 // MATCH_PARENT spec + parent container size can be used to limit
2000                 if (layout != null)
2001                 {
2002                     layout.RequestLayout();
2003                 }
2004                 SetValue(MaximumSizeProperty, value);
2005                 NotifyPropertyChanged();
2006             }
2007         }
2008
2009         /// <summary>
2010         /// Gets or sets whether a child view inherits it's parent's position.<br />
2011         /// Default is to inherit.<br />
2012         /// 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 />
2013         /// </summary>
2014         /// <since_tizen> 3 </since_tizen>
2015         public bool InheritPosition
2016         {
2017             get
2018             {
2019                 return (bool)GetValue(InheritPositionProperty);
2020             }
2021             set
2022             {
2023                 SetValue(InheritPositionProperty, value);
2024                 NotifyPropertyChanged();
2025             }
2026         }
2027
2028         /// <summary>
2029         /// Gets or sets the clipping behavior (mode) of it's children.
2030         /// </summary>
2031         /// <since_tizen> 3 </since_tizen>
2032         public ClippingModeType ClippingMode
2033         {
2034             get
2035             {
2036                 return (ClippingModeType)GetValue(ClippingModeProperty);
2037             }
2038             set
2039             {
2040                 SetValue(ClippingModeProperty, value);
2041                 NotifyPropertyChanged();
2042             }
2043         }
2044
2045         /// <summary>
2046         /// Gets the number of renderers held by the view.
2047         /// </summary>
2048         /// <since_tizen> 3 </since_tizen>
2049         public uint RendererCount
2050         {
2051             get
2052             {
2053                 return GetRendererCount();
2054             }
2055         }
2056
2057         /// <summary>
2058         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
2059         /// </summary>
2060         /// <remarks>
2061         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2062         /// </remarks>
2063         /// <since_tizen> 3 </since_tizen>
2064         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
2065             "Like: " +
2066             "View view = new View(); " +
2067             "view.PivotPoint = PivotPoint.Center; " +
2068             "view.PositionUsesPivotPoint = true;")]
2069         [EditorBrowsable(EditorBrowsableState.Never)]
2070         public Position AnchorPoint
2071         {
2072             get
2073             {
2074                 Position temp = new Position(0.0f, 0.0f, 0.0f);
2075                 var pValue = GetProperty(View.Property.AnchorPoint);
2076                 pValue.Get(temp);
2077                 pValue.Dispose();
2078                 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2079                 temp.Dispose();
2080                 return ret;
2081             }
2082             set
2083             {
2084                 var temp = new Tizen.NUI.PropertyValue(value);
2085                 SetProperty(View.Property.AnchorPoint, temp);
2086                 temp.Dispose();
2087                 NotifyPropertyChanged();
2088             }
2089         }
2090
2091         /// <summary>
2092         /// Sets the size of a view for the width, the height and the depth.<br />
2093         /// Geometry can be scaled to fit within this area.<br />
2094         /// This does not interfere with the view's scale factor.<br />
2095         /// The views default depth is the minimum of width and height.<br />
2096         /// </summary>
2097         /// <remarks>
2098         /// <para>
2099         /// Animatable - This property can be animated using <c>Animation</c> class.
2100         /// </para>
2101         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
2102         /// </remarks>
2103         /// <since_tizen> 5 </since_tizen>
2104         public Size Size
2105         {
2106             get
2107             {
2108                 Size tmp = (Size)GetValue(SizeProperty);
2109                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
2110             }
2111             set
2112             {
2113                 SetValue(SizeProperty, value);
2114                 NotifyPropertyChanged();
2115             }
2116         }
2117
2118         /// <summary>
2119         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
2120         /// </summary>
2121         /// <since_tizen> 3 </since_tizen>
2122         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
2123             "Like: " +
2124             "Container parent =  view.GetParent(); " +
2125             "View view = parent as View;")]
2126         [EditorBrowsable(EditorBrowsableState.Never)]
2127         public new View Parent
2128         {
2129             get
2130             {
2131                 View ret;
2132                 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2133                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2134                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2135
2136                 if (basehandle is Layer layer)
2137                 {
2138                     ret = new View(Layer.getCPtr(layer).Handle, false);
2139                     NUILog.Error("This Parent property is deprecated, should do not be used");
2140                 }
2141                 else
2142                 {
2143                     ret = basehandle as View;
2144                 }
2145
2146                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2147                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2148
2149                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2150                 return ret;
2151             }
2152         }
2153
2154         /// <summary>
2155         /// Gets/Sets whether inherit parent's the layout Direction.
2156         /// </summary>
2157         /// <since_tizen> 4 </since_tizen>
2158         public bool InheritLayoutDirection
2159         {
2160             get
2161             {
2162                 return (bool)GetValue(InheritLayoutDirectionProperty);
2163             }
2164             set
2165             {
2166                 SetValue(InheritLayoutDirectionProperty, value);
2167                 NotifyPropertyChanged();
2168             }
2169         }
2170
2171         /// <summary>
2172         /// Gets/Sets the layout Direction.
2173         /// </summary>
2174         /// <since_tizen> 4 </since_tizen>
2175         public ViewLayoutDirectionType LayoutDirection
2176         {
2177             get
2178             {
2179                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2180             }
2181             set
2182             {
2183                 SetValue(LayoutDirectionProperty, value);
2184                 NotifyPropertyChanged();
2185                 layout?.RequestLayout();
2186             }
2187         }
2188
2189         /// <summary>
2190         /// Gets or sets the Margin for use in layout.
2191         /// </summary>
2192         /// <remarks>
2193         /// Margin property is supported by Layout algorithms and containers.
2194         /// Please Set Layout if you want to use Margin property.
2195         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
2196         /// </remarks>
2197         /// <since_tizen> 4 </since_tizen>
2198         public Extents Margin
2199         {
2200             get
2201             {
2202                 // If View has a Layout then margin is stored in Layout.
2203                 if (Layout != null)
2204                 {
2205                     return Layout.Margin;
2206                 }
2207                 else
2208                 {
2209                     // If Layout not set then return margin stored in View.
2210                     Extents temp = (Extents)GetValue(MarginProperty);
2211                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2212                 }
2213                 // Two return points to prevent creating a zeroed Extent native object before assignment
2214             }
2215             set
2216             {
2217                 if (Layout != null)
2218                 {
2219                     // Layout set so store Margin in LayoutItem instead of View.
2220                     // If View stores the Margin too then the Legacy Size Negotiation will
2221                     // overwrite the position and size values measured in the Layouting.
2222                     Layout.Margin = value;
2223                     SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2224                     layout?.RequestLayout();
2225                 }
2226                 else
2227                 {
2228                     SetValue(MarginProperty, value);
2229                 }
2230                 NotifyPropertyChanged();
2231                 layout?.RequestLayout();
2232             }
2233         }
2234
2235         ///<summary>
2236         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
2237         ///</summary>
2238         /// <since_tizen> 6 </since_tizen>
2239         public int WidthSpecification
2240         {
2241             get
2242             {
2243                 return widthPolicy;
2244             }
2245             set
2246             {
2247                 if (value == widthPolicy)
2248                     return;
2249
2250                 widthPolicy = value;
2251                 if (widthPolicy >= 0)
2252                 {
2253                     if (heightPolicy >= 0) // Policy an exact value
2254                     {
2255                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2256                         Size2D = new Size2D(widthPolicy, heightPolicy);
2257                     }
2258                 }
2259                 layout?.RequestLayout();
2260             }
2261         }
2262
2263         ///<summary>
2264         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
2265         ///</summary>
2266         /// <since_tizen> 6 </since_tizen>
2267         public int HeightSpecification
2268         {
2269             get
2270             {
2271                 return heightPolicy;
2272             }
2273             set
2274             {
2275                 if (value == heightPolicy)
2276                     return;
2277
2278                 heightPolicy = value;
2279                 if (heightPolicy >= 0)
2280                 {
2281                     if (widthPolicy >= 0) // Policy an exact value
2282                     {
2283                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2284                         Size2D = new Size2D(widthPolicy, heightPolicy);
2285                     }
2286                 }
2287                 layout?.RequestLayout();
2288             }
2289         }
2290
2291         ///<summary>
2292         /// Gets the List of transitions for this View.
2293         ///</summary>
2294         /// <since_tizen> 6 </since_tizen>
2295         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2296         {
2297             get
2298             {
2299                 if (layoutTransitions == null)
2300                 {
2301                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2302                 }
2303                 return layoutTransitions;
2304             }
2305         }
2306
2307         ///<summary>
2308         /// Set a layout transitions for this View.
2309         ///</summary>
2310         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2311         /// <remarks>
2312         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2313         /// </remarks>
2314         /// <since_tizen> 6 </since_tizen>
2315         public LayoutTransition LayoutTransition
2316         {
2317             get
2318             {
2319                 return layoutTransition;
2320             }
2321             set
2322             {
2323                 if (value == null)
2324                 {
2325                     throw new global::System.ArgumentNullException(nameof(value));
2326                 }
2327                 if (layoutTransitions == null)
2328                 {
2329                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2330                 }
2331
2332                 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2333
2334                 AttachTransitionsToChildren(value);
2335
2336                 layoutTransition = value;
2337             }
2338         }
2339
2340         /// <summary>
2341         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2342         /// </summary>
2343         /// <remarks>
2344         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2345         /// </remarks>
2346         /// <since_tizen> 4 </since_tizen>
2347         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2348         [EditorBrowsable(EditorBrowsableState.Never)]
2349         public Extents PaddingEX
2350         {
2351             get
2352             {
2353                 Extents temp = new Extents(0, 0, 0, 0);
2354                 var pValue = GetProperty(View.Property.PADDING);
2355                 pValue.Get(temp);
2356                 pValue.Dispose();
2357                 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2358                 temp.Dispose();
2359                 return ret;
2360             }
2361             set
2362             {
2363                 var temp = new Tizen.NUI.PropertyValue(value);
2364                 SetProperty(View.Property.PADDING, temp);
2365                 temp.Dispose();
2366                 NotifyPropertyChanged();
2367                 layout?.RequestLayout();
2368             }
2369         }
2370
2371         /// <summary>
2372         /// The Color of View. This is an RGBA value.
2373         /// </summary>
2374         /// <remarks>
2375         /// <para>
2376         /// Animatable - This property can be animated using <c>Animation</c> class.
2377         /// </para>
2378         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2379         /// </remarks>
2380         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2381         [EditorBrowsable(EditorBrowsableState.Never)]
2382         public Color Color
2383         {
2384             get
2385             {
2386                 Color temp = (Color)GetValue(ColorProperty);
2387                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2388             }
2389             set
2390             {
2391                 SetValue(ColorProperty, value);
2392                 selectorData?.Color?.Reset(this);
2393                 NotifyPropertyChanged();
2394             }
2395         }
2396
2397         /// <summary>
2398         /// Set the layout on this View. Replaces any existing Layout.
2399         /// </summary>
2400         /// <remarks>
2401         /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2402         /// </remarks>
2403         /// <since_tizen> 6 </since_tizen>
2404         public LayoutItem Layout
2405         {
2406             get
2407             {
2408                 return layout;
2409             }
2410             set
2411             {
2412                 // Do nothing if layout provided is already set on this View.
2413                 if (value == layout)
2414                 {
2415                     return;
2416                 }
2417
2418                 LayoutingDisabled = false;
2419                 layoutSet = true;
2420
2421                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2422                 // First check if the layout to be set already has a owner.
2423                 if (value?.Owner != null)
2424                 {
2425                     // Previous owner of the layout gets a default layout as a replacement.
2426                     value.Owner.Layout = new AbsoluteLayout();
2427
2428                     // Copy Margin and Padding to replacement LayoutGroup.
2429                     if (value.Owner.Layout != null)
2430                     {
2431                         value.Owner.Layout.Margin = value.Margin;
2432                         value.Owner.Layout.Padding = value.Padding;
2433                     }
2434                 }
2435
2436                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2437                 // View if no replacement. Previously margin and padding values would have been moved from
2438                 // the View to the layout.
2439                 if (layout != null) // Existing layout
2440                 {
2441                     if (value != null)
2442                     {
2443                         // Existing layout being replaced so copy over margin and padding values.
2444                         value.Margin = layout.Margin;
2445                         value.Padding = layout.Padding;
2446                     }
2447                     else
2448                     {
2449                         // Layout not being replaced so restore margin and padding to View.
2450                         SetValue(MarginProperty, layout.Margin);
2451                         SetValue(PaddingProperty, layout.Padding);
2452                         NotifyPropertyChanged();
2453                     }
2454                 }
2455                 else
2456                 {
2457                     // First Layout to be added to the View hence copy
2458
2459                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2460                     if (value != null)
2461                     {
2462                         Extents margin = Margin;
2463                         Extents padding = Padding;
2464                         if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2465                         {
2466                             // If View already has a margin set then store it in Layout instead.
2467                             value.Margin = margin;
2468                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2469                             NotifyPropertyChanged();
2470                         }
2471
2472                         if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2473                         {
2474                             // If View already has a padding set then store it in Layout instead.
2475                             value.Padding = padding;
2476
2477                             // If Layout is a LayoutItem then it could be a View that handles it's own padding.
2478                             // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
2479                             if (typeof(LayoutGroup).IsAssignableFrom(value.GetType()))
2480                             {
2481                                 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2482                                 NotifyPropertyChanged();
2483                             }
2484                         }
2485                     }
2486                 }
2487
2488                 // Remove existing layout from it's parent layout group.
2489                 layout?.Unparent();
2490
2491                 value.SetPositionByLayout = !excludeLayouting;
2492
2493                 // Set layout to this view
2494                 SetLayout(value);
2495             }
2496         }
2497
2498         /// <summary>
2499         /// The weight of the View, used to share available space in a layout with siblings.
2500         /// </summary>
2501         /// <since_tizen> 6 </since_tizen>
2502         public float Weight
2503         {
2504             get
2505             {
2506                 return weight;
2507             }
2508             set
2509             {
2510                 weight = value;
2511                 layout?.RequestLayout();
2512             }
2513         }
2514
2515         /// <summary>
2516         ///  Whether to load the BackgroundImage synchronously.
2517         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2518         ///  Note: For Normal Quad images only.
2519         /// </summary>
2520         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2521         [EditorBrowsable(EditorBrowsableState.Never)]
2522         public bool BackgroundImageSynchronosLoading
2523         {
2524             get
2525             {
2526                 return backgroundImageSynchronosLoading;
2527             }
2528             set
2529             {
2530                 backgroundImageSynchronosLoading = value;
2531
2532                 string bgUrl = null;
2533                 var pValue = Background.Find(ImageVisualProperty.URL);
2534                 pValue?.Get(out bgUrl);
2535                 pValue?.Dispose();
2536
2537                 if (!string.IsNullOrEmpty(bgUrl))
2538                 {
2539                     PropertyMap bgMap = this.Background;
2540                     var temp = new PropertyValue(backgroundImageSynchronosLoading);
2541                     bgMap.Add("synchronousLoading", temp);
2542                     temp.Dispose();
2543                     Background = bgMap;
2544                 }
2545             }
2546         }
2547
2548         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2549         [EditorBrowsable(EditorBrowsableState.Never)]
2550         public Vector2 UpdateSizeHint
2551         {
2552             get
2553             {
2554                 return (Vector2)GetValue(UpdateSizeHintProperty);
2555             }
2556             set
2557             {
2558                 SetValue(UpdateSizeHintProperty, value);
2559                 NotifyPropertyChanged();
2560             }
2561         }
2562
2563         /// <summary>
2564         /// Enable/Disable ControlState propagation for children.
2565         /// It is false by default.
2566         /// If the View needs to share ControlState with descendants, please set it true.
2567         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2568         /// </summary>
2569         [EditorBrowsable(EditorBrowsableState.Never)]
2570         public bool EnableControlStatePropagation
2571         {
2572             get => controlStatePropagation;
2573             set
2574             {
2575                 controlStatePropagation = value;
2576
2577                 foreach (View child in Children)
2578                 {
2579                     child.EnableControlStatePropagation = value;
2580                 }
2581             }
2582         }
2583
2584         /// <summary>
2585         /// By default, it is false in View, true in Control.
2586         /// Note that if the value is true, the View will be a touch receptor.
2587         /// </summary>
2588         [EditorBrowsable(EditorBrowsableState.Never)]
2589         public bool EnableControlState
2590         {
2591             get
2592             {
2593                 return (bool)GetValue(EnableControlStateProperty);
2594             }
2595             set
2596             {
2597                 SetValue(EnableControlStateProperty, value);
2598             }
2599         }
2600
2601         /// <summary>
2602         /// Whether the actor grab all touches even if touch leaves its boundary.
2603         /// </summary>
2604         /// <returns>true, if it grab all touch after start</returns>
2605         [EditorBrowsable(EditorBrowsableState.Never)]
2606         public bool GrabTouchAfterLeave
2607         {
2608             get
2609             {
2610                 bool temp = false;
2611                 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
2612                 pValue.Get(out temp);
2613                 pValue.Dispose();
2614                 return temp;
2615             }
2616             set
2617             {
2618                 var temp = new Tizen.NUI.PropertyValue(value);
2619                 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
2620                 temp.Dispose();
2621                 NotifyPropertyChanged();
2622             }
2623         }
2624
2625         /// <summary>
2626         /// Determines which blend equation will be used to render renderers of this actor.
2627         /// </summary>
2628         /// <returns>blend equation enum currently assigned</returns>
2629         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
2630         [EditorBrowsable(EditorBrowsableState.Never)]
2631         public BlendEquationType BlendEquation
2632         {
2633             get
2634             {
2635                 int temp = 0;
2636                 var pValue = GetProperty(View.Property.BlendEquation);
2637                 pValue.Get(out temp);
2638                 pValue.Dispose();
2639                 return (BlendEquationType)temp;
2640             }
2641             set
2642             {
2643                 var temp = new Tizen.NUI.PropertyValue((int)value);
2644                 SetProperty(View.Property.BlendEquation, temp);
2645                 temp.Dispose();
2646                 NotifyPropertyChanged();
2647             }
2648         }
2649
2650         /// <summary>
2651         /// If the value is true, the View will change its style as the theme changes.
2652         /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
2653         /// </summary>
2654         [EditorBrowsable(EditorBrowsableState.Never)]
2655         public bool ThemeChangeSensitive
2656         {
2657             get => (bool)GetValue(ThemeChangeSensitiveProperty);
2658             set => SetValue(ThemeChangeSensitiveProperty, value);
2659         }
2660
2661         /// <summary>
2662         /// Create Style, it is abstract function and must be override.
2663         /// </summary>
2664         [EditorBrowsable(EditorBrowsableState.Never)]
2665         protected virtual ViewStyle CreateViewStyle()
2666         {
2667             return new ViewStyle();
2668         }
2669
2670         /// <summary>
2671         /// Called after the View's ControlStates changed.
2672         /// </summary>
2673         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2674         [EditorBrowsable(EditorBrowsableState.Never)]
2675         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2676         {
2677         }
2678
2679         /// <summary>
2680         /// </summary>
2681         [EditorBrowsable(EditorBrowsableState.Never)]
2682         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
2683         {
2684             UpdateStyle();
2685         }
2686
2687         private bool IsViewPropertyDirty(BindableProperty styleProperty)
2688         {
2689             if (dirtyPropertySet.Count == 0)
2690             {
2691                 return false;
2692             }
2693
2694             if (styleProperty.ReturnType.IsGenericType && styleProperty.ReturnType.GetGenericTypeDefinition() == typeof(Selector<>))
2695             {
2696                 return dirtyPropertySet.Contains(styleProperty.PropertyName.Substring(0, styleProperty.PropertyName.Length - 8));
2697             }
2698
2699             return dirtyPropertySet.Contains(styleProperty.PropertyName);
2700         }
2701
2702         /// <summary>
2703         /// Apply style instance to the view.
2704         /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
2705         /// </summary>
2706         [EditorBrowsable(EditorBrowsableState.Never)]
2707         public virtual void ApplyStyle(ViewStyle viewStyle)
2708         {
2709             if (viewStyle == null || this.viewStyle == viewStyle) return;
2710
2711             this.viewStyle = viewStyle;
2712
2713             if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
2714             {
2715                 // Nothing to apply
2716                 return;
2717             }
2718
2719             if (dirtyPropertySet == null)
2720             {
2721                 dirtyPropertySet = new HashSet<string>();
2722             }
2723
2724             BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
2725
2726             if (bindablePropertyOfView == null)
2727             {
2728                 return;
2729             }
2730
2731             var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
2732             viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
2733
2734             foreach (var sourceProperty in dirtyStyleProperties)
2735             {
2736                 if (blockSetDirty && IsViewPropertyDirty(sourceProperty))
2737                 {
2738                     // Skip applying theme style for a property set by user.
2739                     continue;
2740                 }
2741
2742                 var sourceValue = viewStyle.GetValue(sourceProperty);
2743
2744                 if (sourceValue == null)
2745                 {
2746                     continue;
2747                 }
2748
2749                 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
2750
2751                 if (destinationProperty != null)
2752                 {
2753                     SetValue(destinationProperty, sourceValue);
2754                 }
2755             }
2756         }
2757
2758         /// <summary>
2759         /// Get whether the View is culled or not.
2760         /// True means that the View is out of the view frustum.
2761         /// </summary>
2762         /// <remarks>
2763         /// Hidden-API (Inhouse-API).
2764         /// </remarks>
2765         [EditorBrowsable(EditorBrowsableState.Never)]
2766         public bool Culled
2767         {
2768             get
2769             {
2770                 bool temp = false;
2771                 var pValue = GetProperty(View.Property.Culled);
2772                 pValue.Get(out temp);
2773                 pValue.Dispose();
2774                 return temp;
2775             }
2776         }
2777
2778     }
2779 }