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