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