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