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