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