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