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