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