0006b64a28851dfc446753f46d1eb38181efd796
[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 the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
932         /// Note : Default value is true.
933         /// </summary>
934         [EditorBrowsable(EditorBrowsableState.Never)]
935         public bool FocusableChildren
936         {
937             set
938             {
939                 SetValue(FocusableChildrenProperty, value);
940                 NotifyPropertyChanged();
941             }
942             get
943             {
944                 return (bool)GetValue(FocusableChildrenProperty);
945             }
946         }
947
948         /// <summary>
949         /// Whether this view can focus by touch.
950         /// If Focusable is false, FocusableInTouch is disabled.
951         /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
952         /// </summary>
953         [EditorBrowsable(EditorBrowsableState.Never)]
954         public bool FocusableInTouch
955         {
956             set
957             {
958                 SetValue(FocusableInTouchProperty, value);
959                 NotifyPropertyChanged();
960             }
961             get
962             {
963                 return (bool)GetValue(FocusableInTouchProperty);
964             }
965         }
966
967         /// <summary>
968         ///  Retrieves the position of the view.<br />
969         ///  The coordinates are relative to the view's parent.<br />
970         /// </summary>
971         /// <since_tizen> 3 </since_tizen>
972         public Position CurrentPosition
973         {
974             get
975             {
976                 return GetCurrentPosition();
977             }
978         }
979
980         /// <summary>
981         /// Sets the size of a view for the width and the height.<br />
982         /// Geometry can be scaled to fit within this area.<br />
983         /// This does not interfere with the view's scale factor.<br />
984         /// The views default depth is the minimum of width and height.<br />
985         /// </summary>
986         /// <remarks>
987         /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
988         /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
989         /// </remarks>
990         /// <since_tizen> 3 </since_tizen>
991         public Size2D Size2D
992         {
993             get
994             {
995                 Size2D temp = (Size2D)GetValue(Size2DProperty);
996                 int width = temp.Width;
997                 int height = temp.Height;
998
999                 if (this.Layout == null)
1000                 {
1001                     if (width < 0) { width = 0; }
1002                     if (height < 0) { height = 0; }
1003                 }
1004
1005                 return new Size2D(OnSize2DChanged, width, height);
1006             }
1007             set
1008             {
1009                 SetValue(Size2DProperty, value);
1010
1011                 NotifyPropertyChanged();
1012             }
1013         }
1014
1015         /// <summary>
1016         ///  Retrieves the size of the view.<br />
1017         ///  The coordinates are relative to the view's parent.<br />
1018         /// </summary>
1019         /// <since_tizen> 3 </since_tizen>
1020         public Size2D CurrentSize
1021         {
1022             get
1023             {
1024                 return GetCurrentSize();
1025             }
1026         }
1027
1028         /// <summary>
1029         /// Retrieves and sets the view's opacity.<br />
1030         /// </summary>
1031         /// <remarks>
1032         /// <para>
1033         /// Animatable - This property can be animated using <c>Animation</c> class.
1034         /// <code>
1035         /// animation.AnimateTo(view, "Opacity", 0.5f);
1036         /// </code>
1037         /// </para>
1038         /// </remarks>
1039         /// <since_tizen> 3 </since_tizen>
1040         public float Opacity
1041         {
1042             get
1043             {
1044                 return (float)GetValue(OpacityProperty);
1045             }
1046             set
1047             {
1048                 SetValue(OpacityProperty, value);
1049                 NotifyPropertyChanged();
1050             }
1051         }
1052
1053         /// <summary>
1054         /// Sets the position of the view for X and Y.<br />
1055         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1056         /// If the position inheritance is disabled, sets the world position.<br />
1057         /// </summary>
1058         /// <remarks>
1059         /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
1060         /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
1061         /// </remarks>
1062         /// <since_tizen> 3 </since_tizen>
1063         public Position2D Position2D
1064         {
1065             get
1066             {
1067                 Position2D temp = (Position2D)GetValue(Position2DProperty);
1068                 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
1069             }
1070             set
1071             {
1072                 SetValue(Position2DProperty, value);
1073                 NotifyPropertyChanged();
1074             }
1075         }
1076
1077         /// <summary>
1078         /// Retrieves the screen position of the view.<br />
1079         /// </summary>
1080         /// <since_tizen> 3 </since_tizen>
1081         public Vector2 ScreenPosition
1082         {
1083             get
1084             {
1085                 Vector2 temp = new Vector2(0.0f, 0.0f);
1086                 var pValue = GetProperty(View.Property.ScreenPosition);
1087                 pValue.Get(temp);
1088                 pValue.Dispose();
1089                 return temp;
1090             }
1091         }
1092
1093         /// <summary>
1094         /// Determines whether the pivot point should be used to determine the position of the view.
1095         /// This is false by default.
1096         /// </summary>
1097         /// <remarks>If false, then the top-left of the view is used for the position.
1098         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1099         /// </remarks>
1100         /// <since_tizen> 3 </since_tizen>
1101         public bool PositionUsesPivotPoint
1102         {
1103             get
1104             {
1105                 return (bool)GetValue(PositionUsesPivotPointProperty);
1106             }
1107             set
1108             {
1109                 SetValue(PositionUsesPivotPointProperty, value);
1110                 NotifyPropertyChanged();
1111             }
1112         }
1113
1114         /// <summary>
1115         /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
1116         /// </summary>
1117         /// <since_tizen> 3 </since_tizen>
1118         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
1119             "Like: " +
1120             "View view = new View(); " +
1121             "view.PivotPoint = PivotPoint.Center; " +
1122             "view.PositionUsesPivotPoint = true;" +
1123             " Deprecated in API5: Will be removed in API8")]
1124         [EditorBrowsable(EditorBrowsableState.Never)]
1125         public bool PositionUsesAnchorPoint
1126         {
1127             get
1128             {
1129                 bool temp = false;
1130                 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1131                 pValue.Get(out temp);
1132                 pValue.Dispose();
1133                 return temp;
1134             }
1135             set
1136             {
1137                 var temp = new Tizen.NUI.PropertyValue(value);
1138                 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1139                 temp.Dispose();
1140                 NotifyPropertyChanged();
1141             }
1142         }
1143
1144         /// <summary>
1145         /// Queries whether the view is connected to the stage.<br />
1146         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1147         /// </summary>
1148         /// <since_tizen> 3 </since_tizen>
1149         public bool IsOnWindow
1150         {
1151             get
1152             {
1153                 return OnWindow();
1154             }
1155         }
1156
1157         /// <summary>
1158         /// Gets the depth in the hierarchy for the view.
1159         /// </summary>
1160         /// <since_tizen> 3 </since_tizen>
1161         public int HierarchyDepth
1162         {
1163             get
1164             {
1165                 return GetHierarchyDepth();
1166             }
1167         }
1168
1169         /// <summary>
1170         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1171         /// </summary>
1172         /// <remarks>
1173         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1174         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1175         /// The values set by this property will likely change.
1176         /// </remarks>
1177         /// <since_tizen> 3 </since_tizen>
1178         public int SiblingOrder
1179         {
1180             get
1181             {
1182                 return (int)GetValue(SiblingOrderProperty);
1183             }
1184             set
1185             {
1186                 SetValue(SiblingOrderProperty, value);
1187
1188                 LayoutGroup layout = Layout as LayoutGroup;
1189                 layout?.ChangeLayoutSiblingOrder(value);
1190
1191                 NotifyPropertyChanged();
1192             }
1193         }
1194
1195         /// <summary>
1196         /// Returns the natural size of the view.
1197         /// </summary>
1198         /// <remarks>
1199         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1200         /// </remarks>
1201         /// <since_tizen> 5 </since_tizen>
1202         public Vector3 NaturalSize
1203         {
1204             get
1205             {
1206                 Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1207                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1208                 return ret;
1209             }
1210         }
1211
1212         /// <summary>
1213         /// Returns the natural size (Size2D) of the view.
1214         /// </summary>
1215         /// <remarks>
1216         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1217         /// </remarks>
1218         /// <since_tizen> 4 </since_tizen>
1219         public Size2D NaturalSize2D
1220         {
1221             get
1222             {
1223                 Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1224                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1225
1226                 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1227                 temp.Dispose();
1228                 return sz;
1229             }
1230         }
1231
1232         /// <summary>
1233         /// Gets or sets the origin of a view within its parent's area.<br />
1234         /// 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 />
1235         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1236         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1237         /// </summary>
1238         /// <pre>The view has been initialized.</pre>
1239         /// <since_tizen> 3 </since_tizen>
1240         public Position ParentOrigin
1241         {
1242             get
1243             {
1244                 Position tmp = (Position)GetValue(ParentOriginProperty);
1245                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1246             }
1247             set
1248             {
1249                 SetValue(ParentOriginProperty, value);
1250                 NotifyPropertyChanged();
1251             }
1252         }
1253
1254         /// <summary>
1255         /// Gets or sets the anchor-point of a view.<br />
1256         /// 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 />
1257         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1258         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1259         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1260         /// <pre>The view has been initialized.</pre>
1261         /// </summary>
1262         /// <remarks>
1263         /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
1264         /// </remarks>
1265         /// <since_tizen> 3 </since_tizen>
1266         public Position PivotPoint
1267         {
1268             get
1269             {
1270                 Position tmp = (Position)GetValue(PivotPointProperty);
1271                 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
1272             }
1273             set
1274             {
1275                 SetValue(PivotPointProperty, value);
1276                 NotifyPropertyChanged();
1277             }
1278         }
1279
1280         /// <summary>
1281         /// Gets or sets the size width of the view.
1282         /// </summary>
1283         /// <remarks>
1284         /// <para>
1285         /// Animatable - This property can be animated using <c>Animation</c> class.
1286         /// <code>
1287         /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1288         /// </code>
1289         /// </para>
1290         /// </remarks>
1291         /// <since_tizen> 3 </since_tizen>
1292         public float SizeWidth
1293         {
1294             get
1295             {
1296                 return (float)GetValue(SizeWidthProperty);
1297             }
1298             set
1299             {
1300                 SetValue(SizeWidthProperty, value);
1301                 NotifyPropertyChanged();
1302             }
1303         }
1304
1305         /// <summary>
1306         /// Gets or sets the size height of the view.
1307         /// </summary>
1308         /// <remarks>
1309         /// <para>
1310         /// Animatable - This property can be animated using <c>Animation</c> class.
1311         /// </para>
1312         /// <code>
1313         /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1314         /// </code>
1315         /// </remarks>
1316         /// <since_tizen> 3 </since_tizen>
1317         public float SizeHeight
1318         {
1319             get
1320             {
1321                 return (float)GetValue(SizeHeightProperty);
1322             }
1323             set
1324             {
1325                 SetValue(SizeHeightProperty, value);
1326                 NotifyPropertyChanged();
1327             }
1328         }
1329
1330         /// <summary>
1331         /// Gets or sets the position of the view.<br />
1332         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1333         /// If the position inheritance is disabled, sets the world position.<br />
1334         /// </summary>
1335         /// <remarks>
1336         /// <para>
1337         /// Animatable - This property can be animated using <c>Animation</c> class.
1338         /// <code>
1339         /// animation.AnimateTo(view, "Position", new Position(50, 0));
1340         /// </code>
1341         /// </para>
1342         /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1343         /// </remarks>
1344         /// <since_tizen> 3 </since_tizen>
1345         public Position Position
1346         {
1347             get
1348             {
1349                 Position tmp = (Position)GetValue(PositionProperty);
1350                 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1351             }
1352             set
1353             {
1354                 SetValue(PositionProperty, value);
1355                 NotifyPropertyChanged();
1356             }
1357         }
1358
1359         /// <summary>
1360         /// Gets or sets the position X of the view.
1361         /// </summary>
1362         /// <remarks>
1363         /// <para>
1364         /// Animatable - This property can be animated using <c>Animation</c> class.
1365         /// <code>
1366         /// animation.AnimateTo(view, "PositionX", 50.0f);
1367         /// </code>
1368         /// </para>
1369         /// </remarks>
1370         /// <since_tizen> 3 </since_tizen>
1371         public float PositionX
1372         {
1373             get
1374             {
1375                 return (float)GetValue(PositionXProperty);
1376             }
1377             set
1378             {
1379                 SetValue(PositionXProperty, value);
1380                 NotifyPropertyChanged();
1381             }
1382         }
1383
1384         /// <summary>
1385         /// Gets or sets the position Y of the view.
1386         /// </summary>
1387         /// <remarks>
1388         /// <para>
1389         /// Animatable - This property can be animated using <c>Animation</c> class.
1390         /// <code>
1391         /// animation.AnimateTo(view, "PositionY", 50.0f);
1392         /// </code>
1393         /// </para>
1394         /// </remarks>
1395         /// <since_tizen> 3 </since_tizen>
1396         public float PositionY
1397         {
1398             get
1399             {
1400                 return (float)GetValue(PositionYProperty);
1401             }
1402             set
1403             {
1404                 SetValue(PositionYProperty, value);
1405                 NotifyPropertyChanged();
1406             }
1407         }
1408
1409         /// <summary>
1410         /// Gets or sets the position Z of the view.
1411         /// </summary>
1412         /// <remarks>
1413         /// <para>
1414         /// Animatable - This property can be animated using <c>Animation</c> class.
1415         /// <code>
1416         /// animation.AnimateTo(view, "PositionZ", 50.0f);
1417         /// </code>
1418         /// </para>
1419         /// </remarks>
1420         /// <since_tizen> 3 </since_tizen>
1421         public float PositionZ
1422         {
1423             get
1424             {
1425                 return (float)GetValue(PositionZProperty);
1426             }
1427             set
1428             {
1429                 SetValue(PositionZProperty, value);
1430                 NotifyPropertyChanged();
1431             }
1432         }
1433
1434         /// <summary>
1435         /// Gets or sets the world position of the view.
1436         /// </summary>
1437         /// <since_tizen> 3 </since_tizen>
1438         public Vector3 WorldPosition
1439         {
1440             get
1441             {
1442                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1443                 var pValue = GetProperty(View.Property.WorldPosition);
1444                 pValue.Get(temp);
1445                 pValue.Dispose();
1446                 return temp;
1447             }
1448         }
1449
1450         /// <summary>
1451         /// Gets or sets the orientation of the view.<br />
1452         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1453         /// </summary>
1454         /// <remarks>
1455         /// <para>
1456         /// This is an asynchronous method.
1457         /// </para>
1458         /// <para>
1459         /// Animatable - This property can be animated using <c>Animation</c> class.
1460         /// <code>
1461         /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1462         /// </code>
1463         /// </para>
1464         /// </remarks>
1465         /// <since_tizen> 3 </since_tizen>
1466         public Rotation Orientation
1467         {
1468             get
1469             {
1470                 return (Rotation)GetValue(OrientationProperty);
1471             }
1472             set
1473             {
1474                 SetValue(OrientationProperty, value);
1475                 NotifyPropertyChanged();
1476             }
1477         }
1478
1479         /// <summary>
1480         /// Gets or sets the world orientation of the view.<br />
1481         /// </summary>
1482         /// <since_tizen> 3 </since_tizen>
1483         public Rotation WorldOrientation
1484         {
1485             get
1486             {
1487                 Rotation temp = new Rotation();
1488                 var pValue = GetProperty(View.Property.WorldOrientation);
1489                 pValue.Get(temp);
1490                 pValue.Dispose();
1491                 return temp;
1492             }
1493         }
1494
1495         /// <summary>
1496         /// Gets or sets the scale factor applied to the view.<br />
1497         /// </summary>
1498         /// <remarks>
1499         /// <para>
1500         /// Animatable - This property can be animated using <c>Animation</c> class.
1501         /// <code>
1502         /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1503         /// </code>
1504         /// </para>
1505         /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1506         /// </remarks>
1507         /// <since_tizen> 3 </since_tizen>
1508         public Vector3 Scale
1509         {
1510             get
1511             {
1512                 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1513                 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1514             }
1515             set
1516             {
1517                 SetValue(ScaleProperty, value);
1518                 NotifyPropertyChanged();
1519             }
1520         }
1521
1522         /// <summary>
1523         /// Gets or sets the scale X factor applied to the view.
1524         /// </summary>
1525         /// <remarks>
1526         /// <para>
1527         /// Animatable - This property can be animated using <c>Animation</c> class.
1528         /// <code>
1529         /// animation.AnimateTo(view, "ScaleX", 1.5f);
1530         /// </code>
1531         /// </para>
1532         /// </remarks>
1533         /// <since_tizen> 3 </since_tizen>
1534         public float ScaleX
1535         {
1536             get
1537             {
1538                 return (float)GetValue(ScaleXProperty);
1539             }
1540             set
1541             {
1542                 SetValue(ScaleXProperty, value);
1543                 NotifyPropertyChanged();
1544             }
1545         }
1546
1547         /// <summary>
1548         /// Gets or sets the scale Y factor applied to the view.
1549         /// </summary>
1550         /// <remarks>
1551         /// <para>
1552         /// Animatable - This property can be animated using <c>Animation</c> class.
1553         /// <code>
1554         /// animation.AnimateTo(view, "ScaleY", 1.5f);
1555         /// </code>
1556         /// </para>
1557         /// </remarks>
1558         /// <since_tizen> 3 </since_tizen>
1559         public float ScaleY
1560         {
1561             get
1562             {
1563                 return (float)GetValue(ScaleYProperty);
1564             }
1565             set
1566             {
1567                 SetValue(ScaleYProperty, value);
1568                 NotifyPropertyChanged();
1569             }
1570         }
1571
1572         /// <summary>
1573         /// Gets or sets the scale Z factor applied to the view.
1574         /// </summary>
1575         /// <remarks>
1576         /// <para>
1577         /// Animatable - This property can be animated using <c>Animation</c> class.
1578         /// <code>
1579         /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1580         /// </code>
1581         /// </para>
1582         /// </remarks>
1583         /// <since_tizen> 3 </since_tizen>
1584         public float ScaleZ
1585         {
1586             get
1587             {
1588                 return (float)GetValue(ScaleZProperty);
1589             }
1590             set
1591             {
1592                 SetValue(ScaleZProperty, value);
1593                 NotifyPropertyChanged();
1594             }
1595         }
1596
1597         /// <summary>
1598         /// Gets the world scale of the view.
1599         /// </summary>
1600         /// <since_tizen> 3 </since_tizen>
1601         public Vector3 WorldScale
1602         {
1603             get
1604             {
1605                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1606                 var pValue = GetProperty(View.Property.WorldScale);
1607                 pValue.Get(temp);
1608                 pValue.Dispose();
1609                 return temp;
1610             }
1611         }
1612
1613         /// <summary>
1614         /// Retrieves the visibility flag of the view.
1615         /// </summary>
1616         /// <remarks>
1617         /// <para>
1618         /// If the view is not visible, then the view and its children will not be rendered.
1619         /// 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.
1620         /// </para>
1621         /// <para>
1622         /// Animatable - This property can be animated using <c>Animation</c> class.
1623         /// <code>
1624         /// animation.AnimateTo(view, "Visibility", false);
1625         /// </code>
1626         /// </para>
1627         /// </remarks>
1628         /// <since_tizen> 3 </since_tizen>
1629         public bool Visibility
1630         {
1631             get
1632             {
1633                 bool temp = false;
1634                 var pValue = GetProperty(View.Property.VISIBLE);
1635                 pValue.Get(out temp);
1636                 pValue.Dispose();
1637                 return temp;
1638             }
1639         }
1640
1641         /// <summary>
1642         /// Gets the view's world color.
1643         /// </summary>
1644         /// <since_tizen> 3 </since_tizen>
1645         public Vector4 WorldColor
1646         {
1647             get
1648             {
1649                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1650                 var pValue = GetProperty(View.Property.WorldColor);
1651                 pValue.Get(temp);
1652                 pValue.Dispose();
1653                 return temp;
1654             }
1655         }
1656
1657         /// <summary>
1658         /// Gets or sets the view's name.
1659         /// </summary>
1660         /// <since_tizen> 3 </since_tizen>
1661         public string Name
1662         {
1663             get
1664             {
1665                 return (string)GetValue(NameProperty);
1666             }
1667             set
1668             {
1669                 SetValue(NameProperty, value);
1670                 NotifyPropertyChanged();
1671             }
1672         }
1673
1674         /// <summary>
1675         /// Get the number of children held by the view.
1676         /// </summary>
1677         /// <since_tizen> 3 </since_tizen>
1678         public new uint ChildCount
1679         {
1680             get
1681             {
1682                 return Convert.ToUInt32(Children.Count);
1683             }
1684         }
1685
1686         /// <summary>
1687         /// Gets the view's ID.
1688         /// Read-only
1689         /// </summary>
1690         /// <since_tizen> 3 </since_tizen>
1691         public uint ID
1692         {
1693             get
1694             {
1695                 return GetId();
1696             }
1697         }
1698
1699         /// <summary>
1700         /// Gets or sets the status of whether the view should emit touch or hover signals.
1701         /// If a View is made insensitive, then the View and its children are not hittable.
1702         /// </summary>
1703         /// <since_tizen> 3 </since_tizen>
1704         public bool Sensitive
1705         {
1706             get
1707             {
1708                 return (bool)GetValue(SensitiveProperty);
1709             }
1710             set
1711             {
1712                 SetValue(SensitiveProperty, value);
1713                 NotifyPropertyChanged();
1714             }
1715         }
1716
1717         /// <summary>
1718         /// 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.
1719         /// </summary>
1720         /// <since_tizen> 3 </since_tizen>
1721         public bool LeaveRequired
1722         {
1723             get
1724             {
1725                 return (bool)GetValue(LeaveRequiredProperty);
1726             }
1727             set
1728             {
1729                 SetValue(LeaveRequiredProperty, value);
1730                 NotifyPropertyChanged();
1731             }
1732         }
1733
1734         /// <summary>
1735         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1736         /// </summary>
1737         /// <since_tizen> 3 </since_tizen>
1738         public bool InheritOrientation
1739         {
1740             get
1741             {
1742                 return (bool)GetValue(InheritOrientationProperty);
1743             }
1744             set
1745             {
1746                 SetValue(InheritOrientationProperty, value);
1747                 NotifyPropertyChanged();
1748             }
1749         }
1750
1751         /// <summary>
1752         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1753         /// </summary>
1754         /// <since_tizen> 3 </since_tizen>
1755         public bool InheritScale
1756         {
1757             get
1758             {
1759                 return (bool)GetValue(InheritScaleProperty);
1760             }
1761             set
1762             {
1763                 SetValue(InheritScaleProperty, value);
1764                 NotifyPropertyChanged();
1765             }
1766         }
1767
1768         /// <summary>
1769         /// Gets or sets the status of how the view and its children should be drawn.<br />
1770         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1771         /// 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 />
1772         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1773         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1774         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1775         /// </summary>
1776         /// <since_tizen> 3 </since_tizen>
1777         public DrawModeType DrawMode
1778         {
1779             get
1780             {
1781                 return (DrawModeType)GetValue(DrawModeProperty);
1782             }
1783             set
1784             {
1785                 SetValue(DrawModeProperty, value);
1786                 NotifyPropertyChanged();
1787             }
1788         }
1789
1790         /// <summary>
1791         /// Gets or sets the relative to parent size factor of the view.<br />
1792         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1793         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1794         /// </summary>
1795         /// <remarks>
1796         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1797         /// </remarks>
1798         /// <since_tizen> 3 </since_tizen>
1799         public Vector3 SizeModeFactor
1800         {
1801             get
1802             {
1803                 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1804                 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1805             }
1806             set
1807             {
1808                 SetValue(SizeModeFactorProperty, value);
1809                 NotifyPropertyChanged();
1810             }
1811         }
1812
1813         /// <summary>
1814         /// Gets or sets the width resize policy to be used.
1815         /// </summary>
1816         /// <since_tizen> 3 </since_tizen>
1817         public ResizePolicyType WidthResizePolicy
1818         {
1819             get
1820             {
1821                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1822             }
1823             set
1824             {
1825                 SetValue(WidthResizePolicyProperty, value);
1826                 NotifyPropertyChanged();
1827             }
1828         }
1829
1830         /// <summary>
1831         /// Gets or sets the height resize policy to be used.
1832         /// </summary>
1833         /// <since_tizen> 3 </since_tizen>
1834         public ResizePolicyType HeightResizePolicy
1835         {
1836             get
1837             {
1838                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1839             }
1840             set
1841             {
1842                 SetValue(HeightResizePolicyProperty, value);
1843                 NotifyPropertyChanged();
1844             }
1845         }
1846
1847         /// <summary>
1848         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1849         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1850         /// </summary>
1851         /// <since_tizen> 3 </since_tizen>
1852         public SizeScalePolicyType SizeScalePolicy
1853         {
1854             get
1855             {
1856                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1857             }
1858             set
1859             {
1860                 SetValue(SizeScalePolicyProperty, value);
1861                 NotifyPropertyChanged();
1862             }
1863         }
1864
1865         /// <summary>
1866         ///  Gets or sets the status of whether the width size is dependent on the height size.
1867         /// </summary>
1868         /// <since_tizen> 3 </since_tizen>
1869         public bool WidthForHeight
1870         {
1871             get
1872             {
1873                 return (bool)GetValue(WidthForHeightProperty);
1874             }
1875             set
1876             {
1877                 SetValue(WidthForHeightProperty, value);
1878                 NotifyPropertyChanged();
1879             }
1880         }
1881
1882         /// <summary>
1883         /// Gets or sets the status of whether the height size is dependent on the width size.
1884         /// </summary>
1885         /// <since_tizen> 3 </since_tizen>
1886         public bool HeightForWidth
1887         {
1888             get
1889             {
1890                 return (bool)GetValue(HeightForWidthProperty);
1891             }
1892             set
1893             {
1894                 SetValue(HeightForWidthProperty, value);
1895                 NotifyPropertyChanged();
1896             }
1897         }
1898
1899         /// <summary>
1900         /// Gets or sets the padding for use in layout.
1901         /// </summary>
1902         /// <remarks>
1903         /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1904         /// </remarks>
1905         /// <since_tizen> 5 </since_tizen>
1906         public Extents Padding
1907         {
1908             get
1909             {
1910                 // If View has a Layout then padding in stored in the base Layout class
1911                 if (Layout != null)
1912                 {
1913                     return Layout.Padding;
1914                 }
1915                 else
1916                 {
1917                     Extents temp = (Extents)GetValue(PaddingProperty);
1918                     return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1919                 }
1920                 // Two return points to prevent creating a zeroed Extent native object before assignment
1921             }
1922             set
1923             {
1924                 Extents padding = value;
1925                 if (Layout != null)
1926                 {
1927                     // Layout set so store Padding in LayoutItem instead of in View.
1928                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
1929                     // the position and sizes measure in the Layouting.
1930                     Layout.Padding = value;
1931                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1932                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
1933                     if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
1934                     {
1935                         padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
1936                     }
1937                 }
1938
1939                 SetValue(PaddingProperty, padding);
1940                 NotifyPropertyChanged();
1941             }
1942         }
1943
1944         /// <summary>
1945         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1946         /// </summary>
1947         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
1948         /// <remarks>
1949         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1950         /// </remarks>
1951         /// <since_tizen> 3 </since_tizen>
1952         public Size2D MinimumSize
1953         {
1954             get
1955             {
1956                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1957                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1958             }
1959             set
1960             {
1961                 if (value == null)
1962                 {
1963                     throw new ArgumentNullException(nameof(value));
1964                 }
1965                 if (layout != null)
1966                 {
1967                     // Note: it only works if minimum size is >= than natural size.
1968                     // To force the size it should be done through the width&height spec or Size2D.
1969                     layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1970                     layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1971                     layout.RequestLayout();
1972                 }
1973                 SetValue(MinimumSizeProperty, value);
1974                 NotifyPropertyChanged();
1975             }
1976         }
1977
1978         /// <summary>
1979         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1980         /// </summary>
1981         /// <remarks>
1982         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1983         /// </remarks>
1984         /// <since_tizen> 3 </since_tizen>
1985         public Size2D MaximumSize
1986         {
1987             get
1988             {
1989                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1990                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1991             }
1992             set
1993             {
1994                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1995                 // MATCH_PARENT spec + parent container size can be used to limit
1996                 if (layout != null)
1997                 {
1998                     layout.RequestLayout();
1999                 }
2000                 SetValue(MaximumSizeProperty, value);
2001                 NotifyPropertyChanged();
2002             }
2003         }
2004
2005         /// <summary>
2006         /// Gets or sets whether a child view inherits it's parent's position.<br />
2007         /// Default is to inherit.<br />
2008         /// 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 />
2009         /// </summary>
2010         /// <since_tizen> 3 </since_tizen>
2011         public bool InheritPosition
2012         {
2013             get
2014             {
2015                 return (bool)GetValue(InheritPositionProperty);
2016             }
2017             set
2018             {
2019                 SetValue(InheritPositionProperty, value);
2020                 NotifyPropertyChanged();
2021             }
2022         }
2023
2024         /// <summary>
2025         /// Gets or sets the clipping behavior (mode) of it's children.
2026         /// </summary>
2027         /// <since_tizen> 3 </since_tizen>
2028         public ClippingModeType ClippingMode
2029         {
2030             get
2031             {
2032                 return (ClippingModeType)GetValue(ClippingModeProperty);
2033             }
2034             set
2035             {
2036                 SetValue(ClippingModeProperty, value);
2037                 NotifyPropertyChanged();
2038             }
2039         }
2040
2041         /// <summary>
2042         /// Gets the number of renderers held by the view.
2043         /// </summary>
2044         /// <since_tizen> 3 </since_tizen>
2045         public uint RendererCount
2046         {
2047             get
2048             {
2049                 return GetRendererCount();
2050             }
2051         }
2052
2053         /// <summary>
2054         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
2055         /// </summary>
2056         /// <remarks>
2057         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2058         /// </remarks>
2059         /// <since_tizen> 3 </since_tizen>
2060         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
2061             "Like: " +
2062             "View view = new View(); " +
2063             "view.PivotPoint = PivotPoint.Center; " +
2064             "view.PositionUsesPivotPoint = true;")]
2065         [EditorBrowsable(EditorBrowsableState.Never)]
2066         public Position AnchorPoint
2067         {
2068             get
2069             {
2070                 Position temp = new Position(0.0f, 0.0f, 0.0f);
2071                 var pValue = GetProperty(View.Property.AnchorPoint);
2072                 pValue.Get(temp);
2073                 pValue.Dispose();
2074                 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2075                 temp.Dispose();
2076                 return ret;
2077             }
2078             set
2079             {
2080                 var temp = new Tizen.NUI.PropertyValue(value);
2081                 SetProperty(View.Property.AnchorPoint, temp);
2082                 temp.Dispose();
2083                 NotifyPropertyChanged();
2084             }
2085         }
2086
2087         /// <summary>
2088         /// Sets the size of a view for the width, the height and the depth.<br />
2089         /// Geometry can be scaled to fit within this area.<br />
2090         /// This does not interfere with the view's scale factor.<br />
2091         /// The views default depth is the minimum of width and height.<br />
2092         /// </summary>
2093         /// <remarks>
2094         /// <para>
2095         /// Animatable - This property can be animated using <c>Animation</c> class.
2096         /// <code>
2097         /// animation.AnimateTo(view, "Size", new Size(100, 100));
2098         /// </code>
2099         /// </para>
2100         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
2101         /// </remarks>
2102         /// <since_tizen> 5 </since_tizen>
2103         public Size Size
2104         {
2105             get
2106             {
2107                 Size tmp = (Size)GetValue(SizeProperty);
2108                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
2109             }
2110             set
2111             {
2112                 SetValue(SizeProperty, value);
2113                 NotifyPropertyChanged();
2114             }
2115         }
2116
2117         /// <summary>
2118         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
2119         /// </summary>
2120         /// <since_tizen> 3 </since_tizen>
2121         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
2122             "Like: " +
2123             "Container parent =  view.GetParent(); " +
2124             "View view = parent as View;")]
2125         [EditorBrowsable(EditorBrowsableState.Never)]
2126         public new View Parent
2127         {
2128             get
2129             {
2130                 View ret;
2131                 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2132                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2133                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2134
2135                 if (basehandle is Layer layer)
2136                 {
2137                     ret = new View(Layer.getCPtr(layer).Handle, false);
2138                     NUILog.Error("This Parent property is deprecated, should do not be used");
2139                 }
2140                 else
2141                 {
2142                     ret = basehandle as View;
2143                 }
2144
2145                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2146                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2147
2148                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2149                 return ret;
2150             }
2151         }
2152
2153         /// <summary>
2154         /// Gets/Sets whether inherit parent's the layout Direction.
2155         /// </summary>
2156         /// <since_tizen> 4 </since_tizen>
2157         public bool InheritLayoutDirection
2158         {
2159             get
2160             {
2161                 return (bool)GetValue(InheritLayoutDirectionProperty);
2162             }
2163             set
2164             {
2165                 SetValue(InheritLayoutDirectionProperty, value);
2166                 NotifyPropertyChanged();
2167             }
2168         }
2169
2170         /// <summary>
2171         /// Gets/Sets the layout Direction.
2172         /// </summary>
2173         /// <since_tizen> 4 </since_tizen>
2174         public ViewLayoutDirectionType LayoutDirection
2175         {
2176             get
2177             {
2178                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2179             }
2180             set
2181             {
2182                 SetValue(LayoutDirectionProperty, value);
2183                 NotifyPropertyChanged();
2184                 layout?.RequestLayout();
2185             }
2186         }
2187
2188         /// <summary>
2189         /// Gets or sets the Margin for use in layout.
2190         /// </summary>
2191         /// <remarks>
2192         /// Margin property is supported by Layout algorithms and containers.
2193         /// Please Set Layout if you want to use Margin property.
2194         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
2195         /// </remarks>
2196         /// <since_tizen> 4 </since_tizen>
2197         public Extents Margin
2198         {
2199             get
2200             {
2201                 // If View has a Layout then margin is stored in Layout.
2202                 if (Layout != null)
2203                 {
2204                     return Layout.Margin;
2205                 }
2206                 else
2207                 {
2208                     // If Layout not set then return margin stored in View.
2209                     Extents temp = (Extents)GetValue(MarginProperty);
2210                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2211                 }
2212                 // Two return points to prevent creating a zeroed Extent native object before assignment
2213             }
2214             set
2215             {
2216                 if (Layout != null)
2217                 {
2218                     // Layout set so store Margin in LayoutItem instead of View.
2219                     // If View stores the Margin too then the Legacy Size Negotiation will
2220                     // overwrite the position and size values measured in the Layouting.
2221                     Layout.Margin = value;
2222                     SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2223                     layout?.RequestLayout();
2224                 }
2225                 else
2226                 {
2227                     SetValue(MarginProperty, value);
2228                 }
2229                 NotifyPropertyChanged();
2230                 layout?.RequestLayout();
2231             }
2232         }
2233
2234         ///<summary>
2235         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2236         ///</summary>
2237         /// <example>
2238         /// <code>
2239         /// // matchParentView matches its size to its parent size.
2240         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2241         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2242         ///
2243         /// // wrapContentView wraps its children with their desired size.
2244         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2245         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2246         ///
2247         /// // exactSizeView shows itself with an exact size.
2248         /// exactSizeView.WidthSpecification = 100;
2249         /// exactSizeView.HeightSpecification = 100;
2250         /// </code>
2251         /// </example>
2252         /// <since_tizen> 6 </since_tizen>
2253         public int WidthSpecification
2254         {
2255             get
2256             {
2257                 return widthPolicy;
2258             }
2259             set
2260             {
2261                 if (value == widthPolicy)
2262                     return;
2263
2264                 widthPolicy = value;
2265                 if (widthPolicy >= 0)
2266                 {
2267                     if (heightPolicy >= 0) // Policy an exact value
2268                     {
2269                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2270                         Size2D = new Size2D(widthPolicy, heightPolicy);
2271                     }
2272                 }
2273                 layout?.RequestLayout();
2274             }
2275         }
2276
2277         ///<summary>
2278         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2279         ///</summary>
2280         /// <example>
2281         /// <code>
2282         /// // matchParentView matches its size to its parent size.
2283         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2284         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2285         ///
2286         /// // wrapContentView wraps its children with their desired size.
2287         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2288         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2289         ///
2290         /// // exactSizeView shows itself with an exact size.
2291         /// exactSizeView.WidthSpecification = 100;
2292         /// exactSizeView.HeightSpecification = 100;
2293         /// </code>
2294         /// </example>
2295         /// <since_tizen> 6 </since_tizen>
2296         public int HeightSpecification
2297         {
2298             get
2299             {
2300                 return heightPolicy;
2301             }
2302             set
2303             {
2304                 if (value == heightPolicy)
2305                     return;
2306
2307                 heightPolicy = value;
2308                 if (heightPolicy >= 0)
2309                 {
2310                     if (widthPolicy >= 0) // Policy an exact value
2311                     {
2312                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2313                         Size2D = new Size2D(widthPolicy, heightPolicy);
2314                     }
2315                 }
2316                 layout?.RequestLayout();
2317             }
2318         }
2319
2320         ///<summary>
2321         /// Gets the List of transitions for this View.
2322         ///</summary>
2323         /// <since_tizen> 6 </since_tizen>
2324         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2325         {
2326             get
2327             {
2328                 if (layoutTransitions == null)
2329                 {
2330                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2331                 }
2332                 return layoutTransitions;
2333             }
2334         }
2335
2336         ///<summary>
2337         /// Sets a layout transitions for this View.
2338         ///</summary>
2339         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2340         /// <remarks>
2341         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2342         /// </remarks>
2343         /// <since_tizen> 6 </since_tizen>
2344         public LayoutTransition LayoutTransition
2345         {
2346             get
2347             {
2348                 return layoutTransition;
2349             }
2350             set
2351             {
2352                 if (value == null)
2353                 {
2354                     throw new global::System.ArgumentNullException(nameof(value));
2355                 }
2356                 if (layoutTransitions == null)
2357                 {
2358                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2359                 }
2360
2361                 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2362
2363                 AttachTransitionsToChildren(value);
2364
2365                 layoutTransition = value;
2366             }
2367         }
2368
2369         /// <summary>
2370         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2371         /// </summary>
2372         /// <remarks>
2373         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2374         /// </remarks>
2375         /// <since_tizen> 4 </since_tizen>
2376         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2377         [EditorBrowsable(EditorBrowsableState.Never)]
2378         public Extents PaddingEX
2379         {
2380             get
2381             {
2382                 Extents temp = new Extents(0, 0, 0, 0);
2383                 var pValue = GetProperty(View.Property.PADDING);
2384                 pValue.Get(temp);
2385                 pValue.Dispose();
2386                 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2387                 temp.Dispose();
2388                 return ret;
2389             }
2390             set
2391             {
2392                 var temp = new Tizen.NUI.PropertyValue(value);
2393                 SetProperty(View.Property.PADDING, temp);
2394                 temp.Dispose();
2395                 NotifyPropertyChanged();
2396                 layout?.RequestLayout();
2397             }
2398         }
2399
2400         /// <summary>
2401         /// The Color of View. This is an RGBA value.
2402         /// </summary>
2403         /// <remarks>
2404         /// <para>
2405         /// Animatable - This property can be animated using <c>Animation</c> class.
2406         /// </para>
2407         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2408         /// </remarks>
2409         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2410         [EditorBrowsable(EditorBrowsableState.Never)]
2411         public Color Color
2412         {
2413             get
2414             {
2415                 Color temp = (Color)GetValue(ColorProperty);
2416                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2417             }
2418             set
2419             {
2420                 SetValue(ColorProperty, value);
2421                 NotifyPropertyChanged();
2422             }
2423         }
2424
2425         /// <summary>
2426         /// Set the layout on this View. Replaces any existing Layout.
2427         /// </summary>
2428         /// <remarks>
2429         /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2430         /// </remarks>
2431         /// <since_tizen> 6 </since_tizen>
2432         public LayoutItem Layout
2433         {
2434             get
2435             {
2436                 return layout;
2437             }
2438             set
2439             {
2440                 // Do nothing if layout provided is already set on this View.
2441                 if (value == layout)
2442                 {
2443                     return;
2444                 }
2445
2446                 LayoutingDisabled = false;
2447                 layoutSet = true;
2448
2449                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2450                 // First check if the layout to be set already has a owner.
2451                 if (value?.Owner != null)
2452                 {
2453                     // Previous owner of the layout gets a default layout as a replacement.
2454                     value.Owner.Layout = new AbsoluteLayout();
2455
2456                     // Copy Margin and Padding to replacement LayoutGroup.
2457                     if (value.Owner.Layout != null)
2458                     {
2459                         value.Owner.Layout.Margin = value.Margin;
2460                         value.Owner.Layout.Padding = value.Padding;
2461                     }
2462                 }
2463
2464                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2465                 // View if no replacement. Previously margin and padding values would have been moved from
2466                 // the View to the layout.
2467                 if (layout != null) // Existing layout
2468                 {
2469                     if (value != null)
2470                     {
2471                         // Existing layout being replaced so copy over margin and padding values.
2472                         value.Margin = layout.Margin;
2473                         value.Padding = layout.Padding;
2474                     }
2475                     else
2476                     {
2477                         // Layout not being replaced so restore margin and padding to View.
2478                         SetValue(MarginProperty, layout.Margin);
2479                         SetValue(PaddingProperty, layout.Padding);
2480                         NotifyPropertyChanged();
2481                     }
2482                 }
2483                 else
2484                 {
2485                     // First Layout to be added to the View hence copy
2486
2487                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2488                     if (value != null)
2489                     {
2490                         Extents margin = Margin;
2491                         Extents padding = Padding;
2492                         if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2493                         {
2494                             // If View already has a margin set then store it in Layout instead.
2495                             value.Margin = margin;
2496                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2497                             NotifyPropertyChanged();
2498                         }
2499
2500                         if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2501                         {
2502                             // If View already has a padding set then store it in Layout instead.
2503                             value.Padding = padding;
2504
2505                             // If Layout is a LayoutItem then it could be a View that handles it's own padding.
2506                             // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
2507                             if (typeof(LayoutGroup).IsAssignableFrom(value.GetType()))
2508                             {
2509                                 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2510                                 NotifyPropertyChanged();
2511                             }
2512                         }
2513                     }
2514                 }
2515
2516                 // Remove existing layout from it's parent layout group.
2517                 layout?.Unparent();
2518
2519                 value.SetPositionByLayout = !excludeLayouting;
2520
2521                 // Set layout to this view
2522                 SetLayout(value);
2523             }
2524         }
2525
2526         /// <summary>
2527         /// The weight of the View, used to share available space in a layout with siblings.
2528         /// </summary>
2529         /// <since_tizen> 6 </since_tizen>
2530         public float Weight
2531         {
2532             get
2533             {
2534                 return weight;
2535             }
2536             set
2537             {
2538                 weight = value;
2539                 layout?.RequestLayout();
2540             }
2541         }
2542
2543         /// <summary>
2544         ///  Whether to load the BackgroundImage synchronously.
2545         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2546         ///  Note: For Normal Quad images only.
2547         /// </summary>
2548         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2549         [EditorBrowsable(EditorBrowsableState.Never)]
2550         public bool BackgroundImageSynchronosLoading
2551         {
2552             get
2553             {
2554                 return backgroundImageSynchronosLoading;
2555             }
2556             set
2557             {
2558                 backgroundImageSynchronosLoading = value;
2559
2560                 string bgUrl = null;
2561                 var pValue = Background.Find(ImageVisualProperty.URL);
2562                 pValue?.Get(out bgUrl);
2563                 pValue?.Dispose();
2564
2565                 if (!string.IsNullOrEmpty(bgUrl))
2566                 {
2567                     PropertyMap bgMap = this.Background;
2568                     var temp = new PropertyValue(backgroundImageSynchronosLoading);
2569                     bgMap.Add("synchronousLoading", temp);
2570                     temp.Dispose();
2571                     Background = bgMap;
2572                 }
2573             }
2574         }
2575
2576         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2577         [EditorBrowsable(EditorBrowsableState.Never)]
2578         public Vector2 UpdateSizeHint
2579         {
2580             get
2581             {
2582                 return (Vector2)GetValue(UpdateSizeHintProperty);
2583             }
2584             set
2585             {
2586                 SetValue(UpdateSizeHintProperty, value);
2587                 NotifyPropertyChanged();
2588             }
2589         }
2590
2591         /// <summary>
2592         /// Enable/Disable ControlState propagation for children.
2593         /// It is false by default.
2594         /// If the View needs to share ControlState with descendants, please set it true.
2595         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2596         /// </summary>
2597         [EditorBrowsable(EditorBrowsableState.Never)]
2598         public bool EnableControlStatePropagation
2599         {
2600             get => themeData?.ControlStatePropagation ?? false;
2601             set
2602             {
2603                 if (EnableControlStatePropagation == value) return;
2604
2605                 if (themeData == null) themeData = new ThemeData();
2606
2607                 themeData.ControlStatePropagation = value;
2608
2609                 foreach (View child in Children)
2610                 {
2611                     child.EnableControlStatePropagation = value;
2612                 }
2613             }
2614         }
2615
2616         /// <summary>
2617         /// By default, it is false in View, true in Control.
2618         /// Note that if the value is true, the View will be a touch receptor.
2619         /// </summary>
2620         [EditorBrowsable(EditorBrowsableState.Never)]
2621         public bool EnableControlState
2622         {
2623             get
2624             {
2625                 return (bool)GetValue(EnableControlStateProperty);
2626             }
2627             set
2628             {
2629                 SetValue(EnableControlStateProperty, value);
2630             }
2631         }
2632
2633         /// <summary>
2634         /// Whether the actor grab all touches even if touch leaves its boundary.
2635         /// </summary>
2636         /// <returns>true, if it grab all touch after start</returns>
2637         [EditorBrowsable(EditorBrowsableState.Never)]
2638         public bool GrabTouchAfterLeave
2639         {
2640             get
2641             {
2642                 bool temp = false;
2643                 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
2644                 pValue.Get(out temp);
2645                 pValue.Dispose();
2646                 return temp;
2647             }
2648             set
2649             {
2650                 var temp = new Tizen.NUI.PropertyValue(value);
2651                 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
2652                 temp.Dispose();
2653                 NotifyPropertyChanged();
2654             }
2655         }
2656
2657         /// <summary>
2658         /// Determines which blend equation will be used to render renderers of this actor.
2659         /// </summary>
2660         /// <returns>blend equation enum currently assigned</returns>
2661         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
2662         [EditorBrowsable(EditorBrowsableState.Never)]
2663         public BlendEquationType BlendEquation
2664         {
2665             get
2666             {
2667                 int temp = 0;
2668                 var pValue = GetProperty(View.Property.BlendEquation);
2669                 pValue.Get(out temp);
2670                 pValue.Dispose();
2671                 return (BlendEquationType)temp;
2672             }
2673             set
2674             {
2675                 var temp = new Tizen.NUI.PropertyValue((int)value);
2676                 SetProperty(View.Property.BlendEquation, temp);
2677                 temp.Dispose();
2678                 NotifyPropertyChanged();
2679             }
2680         }
2681
2682         /// <summary>
2683         /// If the value is true, the View will change its style as the theme changes.
2684         /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
2685         /// </summary>
2686         /// <since_tizen> 9 </since_tizen>
2687         public bool ThemeChangeSensitive
2688         {
2689             get => (bool)GetValue(ThemeChangeSensitiveProperty);
2690             set => SetValue(ThemeChangeSensitiveProperty, value);
2691         }
2692
2693         /// <summary>
2694         /// Create Style, it is abstract function and must be override.
2695         /// </summary>
2696         [EditorBrowsable(EditorBrowsableState.Never)]
2697         protected virtual ViewStyle CreateViewStyle()
2698         {
2699             return new ViewStyle();
2700         }
2701
2702         /// <summary>
2703         /// Called after the View's ControlStates changed.
2704         /// </summary>
2705         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2706         [EditorBrowsable(EditorBrowsableState.Never)]
2707         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2708         {
2709         }
2710
2711         /// <summary>
2712         /// </summary>
2713         [EditorBrowsable(EditorBrowsableState.Never)]
2714         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
2715         {
2716             if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
2717             else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
2718         }
2719
2720         /// <summary>
2721         /// Apply style instance to the view.
2722         /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
2723         /// </summary>
2724         /// <since_tizen> 9 </since_tizen>
2725         public virtual void ApplyStyle(ViewStyle viewStyle)
2726         {
2727             if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
2728
2729             if (themeData == null) themeData = new ThemeData();
2730
2731             themeData.viewStyle = viewStyle;
2732
2733             if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
2734             {
2735                 // Nothing to apply
2736                 return;
2737             }
2738
2739             BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
2740
2741             if (bindablePropertyOfView == null)
2742             {
2743                 return;
2744             }
2745
2746             var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
2747             viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
2748
2749             foreach (var sourceProperty in dirtyStyleProperties)
2750             {
2751                 var sourceValue = viewStyle.GetValue(sourceProperty);
2752
2753                 if (sourceValue == null)
2754                 {
2755                     continue;
2756                 }
2757
2758                 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
2759
2760                 if (destinationProperty != null)
2761                 {
2762                     SetValue(destinationProperty, sourceValue);
2763                 }
2764             }
2765         }
2766
2767         /// <summary>
2768         /// Get whether the View is culled or not.
2769         /// True means that the View is out of the view frustum.
2770         /// </summary>
2771         /// <remarks>
2772         /// Hidden-API (Inhouse-API).
2773         /// </remarks>
2774         [EditorBrowsable(EditorBrowsableState.Never)]
2775         public bool Culled
2776         {
2777             get
2778             {
2779                 bool temp = false;
2780                 var pValue = GetProperty(View.Property.Culled);
2781                 pValue.Get(out temp);
2782                 pValue.Dispose();
2783                 return temp;
2784             }
2785         }
2786
2787         /// <summary>
2788         /// Set or Get TransitionOptions for the page transition.
2789         /// This property is used to define how this view will be transitioned during Page switching.
2790         /// </summary>
2791         /// <since_tizen> 9 </since_tizen>
2792         public TransitionOptions TransitionOptions
2793         {
2794             set
2795             {
2796                 transitionOptions = value;
2797             }
2798             get
2799             {
2800                 return transitionOptions;
2801             }
2802         }
2803     }
2804 }