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