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