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