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