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