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